Origami

Command-line client

An interactive shell on a workspace, and cp, ls and cat for its files.

origami is a small client of the HTTP API. It gives you a shell on a workspace that feels like a remote machine, and the usual file commands across your machine and your workspaces.

Sign in

Bash
npx origami login --url https://api-next.origamidb.xyz --key og_sk_...

login remembers the server and the key. ORIGAMI_URL and ORIGAMI_API_KEY in the environment, or --url and --key on any command, take precedence. logout forgets them.

A shell on a workspace

Bash
npx origami shell notes --create

Every line you type is one command in the workspace notes, and --create makes the workspace if it doesn't exist. The working directory carries over from line to line; variables don't, as described in Concepts. Input piped into origami shell runs as a script.

Inside the shell:

.put <local> [remote]Copy a file from your machine into the workspace
.get <remote> [local]Copy a file from the workspace to your machine
.timing onSay after each command how long it took, and what the service spent it on

Ctrl-C stops waiting for a command. The command itself runs on until it ends or reaches its time limit.

One command

Bash
npx origami exec notes ls -la
npx origami exec notes 'grep -rn TODO . | wc -l'

Everything after the workspace is the command, passed on as it is. origami exec leaves with the command's exit code. --cwd sets where it starts and --timeout how long it may run.

Workspaces

Bash
npx origami workspaces          # list, with ids
npx origami create reports      # make one
npx origami delete reports      # delete one

A workspace is named by its name or its id.

Files

A place in a workspace is written <workspace>:<path>, as scp does:

Bash
npx origami ls -l notes:docs              # a directory
npx origami cp report.pdf notes:docs/     # up, into a directory
npx origami cp -r notes:docs ./backup     # down, with everything in it
npx origami cat notes:docs/a.md           # to standard output
npx origami mv notes:docs/a.md notes:docs/b.md
npx origami rm -r notes:docs/old
npx origami mkdir -p notes:archive/2025
  • A destination that ends in a slash means "into it, under the same name". Any other is the exact name.
  • cp and mv overwrite. With -n they don't.
  • - is standard input or output: echo hi | npx origami cp - notes:hi.txt.
  • ls --json and stat --json print the API's entries.

Exit codes

CodeMeans
0Done
1Failed
2Used wrongly
3Not found
4Already there, or a condition failed
130Interrupted

exec leaves with the code of its command instead.

Timing

--timing, or ORIGAMI_TIMING=1, prints after each command how long each request took and how the service spent it, on standard error. See Timing.

Backlinks