Keyboard shortcuts

Scrolling

dorCtrl+d
Scroll down
uorCtrl+u
Scroll up
Ctrl+e
One line down
Ctrl+y
One line up
gtheng
Top of article
G
Bottom of article

Articles

j
Older article
k
Newer article
O
Open original
H
Open hackernews
R
Open reddit

Lists

jor↓
Next item
kor↑
Previous item
gtheng
First item
G
Last item
oorEnter
Open selected item

Go to

gthenforgtheni
Feed
gthen1–9
Open feed entry
gthenb
Browse
gthenp
Preferences

Search and help

⌘+kCtrl+kor/
Global search
?
Show this help
Esc
Close this help

amp dash x

ampcode.com original

The Amp CLI has a new flag: --execute.

-x for short.

That flag turns on execute mode, which allows for programmatic use of the Amp CLI.

The CLI sends the given prompt to the agent and waits until the agent is done. Then it prints the agent's last message.

$ amp -x "Give me a list of targets in this Makefile. Only the names."
git
zsh
ghostty
atuin
jj
all
$ amp -x "Rename all .markdown files to .md then print the new names."
- readme.markdown → readme.md
- ghostty.markdown → ghostty.md

You can also pipe input to it:

$ echo "what package manager do we use here? reply only with name." | amp -x
pnpm

Execute mode is automatically turned on when you redirect stdout:

$ echo "list all markdown files in here" | amp > output.txt
$ cat output.txt
README.md
CONTRIBUTING.md
YOURE_ABSOLUTELY_RIGHT.md

You can also use execute mode with threads continue:

$ amp -x "what is 2+2?"
4

$ amp threads continue -x "add 5 to that"
9

$ amp threads continue -x "now minus 3"
6