Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
A

act

> 编程语言
Open source

Act Preview files from the command line efficiently. cat for the twenty first century! Features - Flexible input handling - Support for col…

72.2K stars0 likes4 views
WebsiteGitHub

About

Act Preview files from the command line efficiently. cat for the twenty first century! Features - Flexible input handling - Support for col…

Act

Preview files from the command line efficiently. cat for the twenty first century!

Features

  • Flexible input handling
    • Support for colon syntax
    • Support for GitHub like URLs
  • Automatic syntax highlighting based on the file extension (via Pygments)
  • Fast enough for the task

Installation

bash
$ [sudo] gem install act
$ [sudo] easy_install Pygments #optional

Help needed

Follow @fabiopelosin to help me beat @orta in followers count.

Usage

Print a complete file:

bash
$ act lib/act/command.rb

0    require 'colored'
1    require 'claide'
2    require 'active_support/core_ext/string/strip'
[...]

Print the line 10 with the default context (5 lines):

bash
$ act lib/act/command.rb:10

5    module Act
6      class Command < CLAide::Command
7
8        self.command = 'act'
9        self.description = 'Act the command line tool to act on files'
10
11       def self.options
12         [
13           ['--open', "Open the file in $EDITOR instead of printing it"],
14           ['--no-line-numbers', "Show output without line numbers"],
15           ['--version', 'Show the version of Act'],

Open in $EDITOR the file at the given line:

bash
$ act lib/act/command.rb:10 --open

Print from line 8 to line 12:

bash
$ act lib/act/command.rb:8-12

8    self.command = 'act'
9    self.description = 'Act the command line tool to act on files'
10
11   def self.options
12     [

Print from line 10 with 2 lines of context:

bash
$ act lib/act/command.rb:10+2

8    self.command = 'act'
9    self.description = 'Act the command line tool to act on files'
10
11   def self.options
12     [

Show ./lib/act/command.rb from line 8 to line 9:

bash
$ act https://github.com/irrationalfab/act/blob/master/lib/act/command.rb\#L8-L9

8    self.command = 'act'
9    self.description = 'Act the command line tool to act on files'

Open $EDITOR ./lib/act/command.rb at line 8:

bash
$ act https://github.com/irrationalfab/act/blob/master/lib/act/command.rb\#L8-L9

Issues· 1 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Ruby

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedOct 1, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言