margin-cli
The margin command lists, describes and runs the margin agents you have installed. Install
an agent package and it shows up here, nothing else to configure.
pip install margin-cli margin-ai-code-detector
margin run ai-code-detector https://github.com/psf/requests
Commands
margin list [--json] # installed agents (and any that failed to load)
margin info <agent> [--json] # description and input fields
margin run <agent> [INPUT] [options] # run it and print the report
margin version
margin --verbose ... (or -v) prints debug logs on stderr.
Giving an agent its input
The value after the agent's name fills its main input field, which margin info marks as
"positional". For the detector that's the repository URL or path.
--set field=value (or -s, as many times as you need) sets any other field. A value that
parses as JSON is read as JSON (3, true, ["a","b"]), except in text fields, which always
take what you typed. --input file.json (-i) reads the fields from a JSON file, and --set
wins over it.
margin run ai-code-detector ./my-project --set include_tests=true
margin run ai-code-detector --set target=./my-project --set 'paths=["src"]'
margin run ai-code-detector -i input.json -s max_files_for_judge=5
Giving the main field both ways, positionally and with --set, is an error.
Options of margin run
| Option | Meaning |
|---|---|
--format markdown|json, -f |
Report format. Default: JSON when --out ends in .json, otherwise Markdown. |
--out PATH, -o |
Write the report to a file instead of stdout. |
--provider NAME |
LLM provider: local (default), anthropic, openai or mock. |
--model NAME |
Model name, e.g. qwen3.5:9b. |
--max-cost USD |
Spending limit for this run (only matters for hosted providers). |
--quiet, -q |
No progress display. |
--strict |
Treat a partial result as a failure (exit code 4). |
The model comes from your settings (environment variables, settings saved in the web UI, or
.env), but nothing talks to a model unless the agent needs one. Agents that don't use a
model work even with no model server running. If you pass --provider or --model, that
choice is checked before the run starts.
Output streams
Only the report goes to stdout. Progress, warnings and errors go to stderr. This keeps
margin run ... --format json > report.json valid JSON.
Exit codes
| Code | Meaning |
|---|---|
| 0 | The run finished with status ok, or partial without --strict. |
| 1 | The run finished with status error (the report still explains why). |
| 2 | Bad usage or invalid input. |
| 3 | The agent is not installed, or failed to load. |
| 4 | The run finished with status partial and --strict was given. |
| 130 | Cancelled with Ctrl+C. |
Cancelling
Press Ctrl+C once to ask the agent to stop. It gets 5 seconds to finish cleanly, after which it is stopped. Press Ctrl+C again to stop at once.
Metadata
Release files for margin-cli 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| margin_cli-0.1.0.tar.gz | 12.3 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| margin_cli-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 22.5 kB
Release files / margin_cli-0.1.0.tar.gz
| Download URL | margin_cli-0.1.0.tar.gz |
|---|---|
| Size | 12.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bbd479b2e589084330618446aa599b6e39bf8de9879759237dcbb320b2c37328
|
|
BLAKE2b-256 checksum How to use checksums |
87eccae55aa24cdf14671f72b5a6ae021f731878d6796fe095b14780ad5ff39b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.
Transparency logRelease files / margin_cli-0.1.0-py3-none-any.whl
| Download URL | margin_cli-0.1.0-py3-none-any.whl |
|---|---|
| Size | 10.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
dd7641b977ad033b4435ef35714c01d6e302f9d5878c2ca0827bd8314c98ac16
|
|
BLAKE2b-256 checksum How to use checksums |
8dcf467470146d07babebf2f876d97a5479e8cc690fd69891d1357704b06fc64
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.
Transparency logSecurity for margin-cli 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for margin_cli-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.