Skip to main content

CLI for the Assertion API

Project description

Assertion CLI

CLI for the Assertion API.

Usage

The CLI targets https://app.tryassertion.com by default; set ASSERTION_BASE_URL (e.g. http://localhost:8000) to point at another backend.

Run locally from the workspace:

uv run --package assertion-cli asrt --help

Install as a uv tool from PyPI:

uv tool install assertion-cli              # latest
uv tool install --reinstall assertion-cli  # upgrade in place

The CLI package declares all of its direct runtime dependencies. At the moment that set is httpx, pydantic, and typer.

After installation:

asrt install                           # one-time onboarding: write skill files, AGENTS.md/CLAUDE.md pointer, .gitignore
asrt login                             # authenticate this repo (generate a token at Settings → Authentication)
asrt session start                     # per work session: record the diff base (current HEAD)
asrt stacks
asrt checkpoint --stack <stack-id> "Implemented X\nUpdated Y"
asrt checkpoint --continue "Implemented Y"
asrt decision --yes <checkpoint-id>   # optional, only after a failed checkpoint
asrt verify                            # submit final verification (non-blocking)
asrt verify --force                    # submit even when review diff is unchanged
asrt verify-status                     # one-shot poll; loop with your own sleep until terminal

Authentication

asrt login stores your API token in a global, user-level file — ~/.assertion/credentials.json (mode 0600) — with an inverted repo index:

{
  "version": 2,
  "tokens": { "alk_...": ["acme/mvp", "acme/docs"] },
  "repo_index": { "acme/mvp": "alk_...", "acme/docs": "alk_..." }
}

Run it from inside the repo it should authenticate. It validates the token and confirms the repo's origin remote is connected to a stack in the token's workspace before saving the token against that workspace's stack repos, so each repo can target a different workspace while moved folders and fresh clones keep working. asrt logout removes the current repo's saved auth; asrt whoami shows which token is in effect.

Token resolution at call time, in order:

  1. the token in repo_index for the current repo's GitHub owner/repo;
  2. a legacy entry for the current repo path in ~/.assertion/credentials.json;
  3. the ASSERTION_API_TOKEN environment variable (a backup for CI, or repos with no remote that asrt login won't store);

with a clear "run asrt login" error when neither is present. The API base URL defaults to https://app.tryassertion.com; override it with ASSERTION_BASE_URL for a local backend.

Publishing a new version

  1. Bump the version in cli/pyproject.toml.
  2. Commit and push to main.

That's it. The Publish CLI to PyPI workflow auto-triggers on pushes that change cli/pyproject.toml. It reads the version from the file, runs tests, builds, publishes to PyPI, and pushes a cli-v<version> tag.

If the version hasn't changed (e.g. you updated a dependency), the workflow skips publishing — only version bumps trigger a publish.

You can also trigger the workflow manually from the GitHub Actions UI — it reads the version from the current pyproject.toml on main.

Prerequisite: PYPI_TOKEN must be set as a GitHub Actions secret — a PyPI API token with upload scope for assertion-cli.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

assertion_cli-0.5.18.tar.gz (47.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

assertion_cli-0.5.18-py3-none-any.whl (35.7 kB view details)

Uploaded Python 3

File details

Details for the file assertion_cli-0.5.18.tar.gz.

File metadata

  • Download URL: assertion_cli-0.5.18.tar.gz
  • Upload date:
  • Size: 47.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for assertion_cli-0.5.18.tar.gz
Algorithm Hash digest
SHA256 0361eb825632b8d1c7311db6b22eb8e8811bbcdfec06067b7a33acd12cb3f2a5
MD5 e0e56492dba867e3149eb3a9c41219c8
BLAKE2b-256 03a0e3f94d3a646e77491da2a9d8c8977b9cc1c97c06b47ff8d2cfff76e50674

See more details on using hashes here.

File details

Details for the file assertion_cli-0.5.18-py3-none-any.whl.

File metadata

  • Download URL: assertion_cli-0.5.18-py3-none-any.whl
  • Upload date:
  • Size: 35.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for assertion_cli-0.5.18-py3-none-any.whl
Algorithm Hash digest
SHA256 382c655fd3476ceec779b63da68473633307fdd0e56a07a1beb1422d4053c211
MD5 9381a1e200347a6e37f45600980f663f
BLAKE2b-256 6dd50d9133ba2d126e8fffc4718f45346822464582eca8dc68fc8f63b4cb99a7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page