Forge CLI reference

Every command takes a repository by name, org/name or id, except repo show, repo update and repo delete, which take the id. Add --json to any command for a stable JSON envelope. Commands that change something take --idempotency-key, so a retry never acts twice.

auth

CommandExample
auth setup-gitmiosa forge auth setup-git

Makes git use your MIOSA key for https://forge.miosa.ai. --host points it at another Forge host.

repo

CommandExample
repo createmiosa forge repo create hello-forge --visibility private --default-branch main
repo listmiosa forge repo list
repo showmiosa forge repo show <repository-id>
repo clonemiosa forge repo clone hello-forge
repo updatemiosa forge repo update <repository-id> --name "Hello Forge"
repo deletemiosa forge repo delete <repository-id> --yes

repo create also takes --slug and --project-id. repo delete is permanent.

pr

CommandExample
pr newmiosa forge pr new hello-forge --head greeting --title "Change the greeting"
pr listmiosa forge pr list hello-forge --state all
pr showmiosa forge pr show hello-forge 1
pr diffmiosa forge pr diff hello-forge 1 --name-only
pr commentmiosa forge pr comment hello-forge 1 --body "Looks good to me."
pr commentsmiosa forge pr comments hello-forge 1
pr reviewmiosa forge pr review hello-forge 1 --decision approved --body "Ship it."
pr mergemiosa forge pr merge hello-forge 1
pr checkmiosa forge pr check hello-forge 1 --name lint --conclusion passed --head-sha <sha> --file check.json
pr checkoutmiosa forge pr checkout hello-forge 2 --branch review-2
pr closemiosa forge pr close hello-forge 2
pr reopenmiosa forge pr reopen hello-forge 2

pr new takes --base, --body, --draft and --head-repo for a pull request from a fork. pr list filters with --state open|closed|merged|all, --author and --base. pr review --decision is approved, changes_requested or commented. pr check reports a check on the pull request’s head commit and is refused for the pull request’s own author.

check

CommandExample
check reportmiosa forge check report hello-forge --commit <sha> --name unit-tests --conclusion passed --file check.json
check listmiosa forge check list hello-forge --commit <sha>
check suitemiosa forge check suite hello-forge <sha>
check showmiosa forge check show hello-forge <check-id>
check evidencemiosa forge check evidence hello-forge <check-id>

A completed check needs {"evidence": {...}} in --file, up to 64 KB. --status queued or in_progress reports a check that is still running.

policy

CommandExample
policy showmiosa forge policy show hello-forge
policy setmiosa forge policy set hello-forge --approvals 1 --check unit-tests
policy ownersmiosa forge policy owners hello-forge

See branch policy for every flag.

grant

CommandExample
grant setmiosa forge grant set hello-forge <user-id> --role write

Roles are read, write, maintain and admin.

fork

CommandExample
forkmiosa forge fork hello-forge --name hello-forge-fork

release

CommandExample
release tagmiosa forge release tag hello-forge --name v0.1.0 --message "First tag"
release newmiosa forge release new hello-forge --tag v0.1.0 --name "First release" --body "Hello from Forge."
release uploadmiosa forge release upload hello-forge v0.1.0 --source-archive
release listmiosa forge release list hello-forge
release showmiosa forge release show hello-forge v0.1.0

release new creates the tag if it does not exist; --commit picks what it points at and --prerelease marks it. release upload attaches files, or a .tar.gz of the tagged commit with --source-archive.

Was this page helpful?