freeagent is an unofficial command-line client for the
FreeAgent API. It is designed for people, shell
scripts, and software agents. It provides explicit account profiles,
machine-readable discovery, stable JSON output, and guarded financial writes.
This project is independent of FreeAgent. It is not endorsed, sponsored, or supported by FreeAgent.
Caution
FreeAgent records can affect accounts, banking, payroll, and tax. Start with a sandbox profile. Review every production mutation. The CLI cannot make an accounting or tax decision for an operator.
Version 0.1.0 is the first public preview. Machine envelopes, error classes, and exit semantics use stable protocol version 1. The CLI release version remains pre-1.0 while its documented command catalog can expand.
- Separate sandbox and production profiles.
- Bring-your-own FreeAgent OAuth application credentials.
- OAuth secrets and rotating refresh tokens in the operating-system keyring.
- Human and agent output modes with separate stdout and stderr contracts.
- Runtime operation discovery through
capabilitiesandschema. - Bounded pagination for agent and batch use.
- Read-only policy controls and guarded production mutations.
- A relative-path raw API command for API features that do not yet have a catalogued resource command.
- A repository Agent Skill in
.agents/skills/freeagent-cli.
Download an archive and checksums.txt from
GitHub Releases, then
put freeagent on PATH.
Go 1.26.7 or later can also install the current source release:
go install github.com/timbrinded/freeagent-cli/cmd/freeagent@latestVerify the installation:
freeagent version --output jsonSee release and installation guidance for checksum, SBOM, and source-build instructions.
- Create and finish setting up a FreeAgent sandbox company.
- Register a FreeAgent OAuth application. Choose an exact IP-loopback redirect
URI, such as
http://127.0.0.1:8484/oauth/callback. - Add a named sandbox profile. Supply the environment, client ID, the same registered redirect URI, and a fixed API date.
- Run
freeagent auth set-client-secret --profile sandbox. Enter the client secret through the hidden prompt, or use--stdinwith a protected password- manager pipe. - Run
freeagent auth login --profile sandbox. Complete the approval in a browser. - Confirm the context before reading data:
freeagent profile show --profile sandbox --output json
freeagent auth status --profile sandbox --agent
freeagent capabilities --profile sandbox --agent
freeagent invoices list --profile sandbox --output json --no-input --per-page 25Never put the client secret, access token, refresh token, or redirected OAuth URL in a command-line argument, a repository, a prompt, or a log.
Read the full quick start and OAuth application setup before using production.
Agent calls must select a profile and disable interaction:
freeagent capabilities --profile sandbox --agent
freeagent schema invoices.list --profile sandbox --agent
freeagent invoices list \
--profile sandbox \
--agent \
--all \
--max-items 100--agent defaults to JSON, disables prompts, and keeps stdout for protocol
data. The CLI does not use terminal colour or a pager in any mode. Diagnostics
and structured errors go to stderr. Use JSONL for long result streams. An
explicit --output raw preserves untrusted upstream bytes and must not write
to a terminal.
Before any write, discover the operation schema, build exact input, and run the
operation's dry-run form. Every write requires the short-lived confirmation
bound to that exact request. This is an anti-accident binding, not proof of
human approval. If the CLI returns exit code 8, the outcome is unknown: read
the target state and reconcile it before considering another write.
The repository skill supplies the complete agent workflow:
.agents/skills/freeagent-cli/SKILL.md.
See agent use and examples.
- Quick start
- OAuth application setup
- Command and protocol reference
- Agent use and approval boundaries
- Security model
- API coverage and known limitations
- Architecture
- Design rationale
- Agent Skill evaluation
- Development
- Releases and installation
- Support
Read CONTRIBUTING.md before opening a change. Report a security problem privately as described in SECURITY.md. Do not put credentials, private financial records, or a vulnerability exploit in a public issue.
MIT. See LICENSE.