aj-tool
v0.1.0
Published
Arcjet CLI for managing teams, sites, and resources
Readme
Arcjet CLI (aj)
An unofficial command-line interface for managing Arcjet teams, sites, API keys, rules, and request logs.
Why not the MCP server?
Arcjet publishes an MCP server that works well when your AI tooling supports it. But MCP servers need to be held in context for the duration of a session, consuming resources even when Arcjet interaction is only needed occasionally.
A CLI is simpler. Any coding agent, script, or CI pipeline can shell out to aj
when needed and move on. All you need in your AGENTS.md or CLAUDE.md is:
Use `aj` to interact with Arcjet (manage teams, sites, API keys, rules, and request logs).No persistent connections, no protocol negotiation, no context window cost.
I built this for my own workflow. When I showed friends, they wanted it too -- so here it is.
Install
Requires Node.js >= 22.
npm install -g aj-toolOr run directly with npx:
npx aj-tool team listAuthentication
The CLI uses your Arcjet dashboard session cookie for authentication. To log in:
- Sign in to app.arcjet.com in your browser
- Open DevTools > Application > Cookies
- Copy the value of the
sessioncookie - Run:
aj login
# Paste your session cookie when promptedFor CI/scripting, pass the session directly:
aj login --session <value>
# or set the environment variable
export ARCJET_SESSION=<value>Your session is stored in ~/.config/arcjet/config.json with 0600 permissions.
Usage
Teams
aj team list
aj team create "My Team"
aj team delete --team-id team_01abc...Sites
aj site list --team-id team_01abc...
aj site create --team-id team_01abc... "My Site"
aj site rename --site-id site_01abc... "New Name"
aj site delete --site-id site_01abc...API Keys
aj apikey --site-id site_01abc...Request Logs
aj request list --site-id site_01abc... --limit 50
aj request get --site-id site_01abc... req_01abc...Rules
aj rule list --site-id site_01abc...
aj rule create --site-id site_01abc... '{"shield": {"mode": "MODE_LIVE"}}'
aj rule delete --site-id site_01abc... remote_rule_01abc...Account
aj whoami
aj logoutGlobal Options
| Flag | Description |
|------|-------------|
| --json | Output raw JSON (useful for scripting and piping) |
| --no-color | Disable colored output |
| --verbose | Show debug information including API calls |
| --version | Print version |
| --help | Show help for any command |
Example:
aj site list --team-id team_01abc... --json | jq '.[].name'Development
git clone https://github.com/bendechrai/aj-tool.git
cd aj-tool
npm install
npm run build
node bin/aj.js --helpFor watch mode during development:
npm run dev # tsc --watch in one terminal
node bin/aj.js team list # test in anotherHow the API Was Documented
This project interacts with Arcjet's management API, which was documented entirely from publicly available sources:
- Arcjet's open-source repositories (arcjet-js, arcjet-py, @arcjet/mcp)
- Standard browser DevTools network inspection of the public Arcjet dashboard
No insider knowledge, private APIs, decompilation, or unauthorized access was used. See docs/API_DISCOVERY_METHODOLOGY.md for full details, and docs/API_REFERENCE.yaml for the OpenAPI spec.
Disclaimer
This is an unofficial project and is not affiliated with, endorsed by, or supported by Arcjet. It interacts with Arcjet's web API, which is undocumented and may change at any time without notice. Use at your own risk.
"Arcjet" is a trademark of Arcjet Limited. This project uses the name solely to describe its functionality.
License
MIT
