|
| 1 | +# forgebit-cli |
| 2 | + |
| 3 | +A standalone CLI for [Forgebit](https://forgebit.io) — issue, verify, and manage software licenses from the terminal, with fully offline signature verification for supported license types. |
| 4 | + |
| 5 | +> Pre-release. No tagged versions or prebuilt binaries yet — see [CHANGELOG.md](CHANGELOG.md). |
| 6 | +
|
| 7 | +## Install |
| 8 | + |
| 9 | +Requires Go 1.26+. |
| 10 | + |
| 11 | +``` |
| 12 | +git clone git@github.com:boone-studios/forgebit-cli.git |
| 13 | +cd forgebit-cli |
| 14 | +go build -o forgebit . |
| 15 | +``` |
| 16 | + |
| 17 | +Move the resulting `forgebit` binary onto your `PATH`. |
| 18 | + |
| 19 | +## Getting started |
| 20 | + |
| 21 | +``` |
| 22 | +forgebit login |
| 23 | +``` |
| 24 | + |
| 25 | +Prints a short code, opens your browser to approve the request, and stores a vendor-scoped API key locally (`~/.config/forgebit/config.json` or your OS equivalent). No password ever touches the CLI. |
| 26 | + |
| 27 | +``` |
| 28 | +forgebit status |
| 29 | +``` |
| 30 | + |
| 31 | +Reports whether the CLI is authenticated against the live API or running offline. |
| 32 | + |
| 33 | +## Multiple vendors |
| 34 | + |
| 35 | +If you operate more than one vendor account, run `forgebit login` again for each — the CLI stores one credential per vendor and switches instantly with no re-authentication: |
| 36 | + |
| 37 | +``` |
| 38 | +forgebit vendor list # see everything you're logged into |
| 39 | +forgebit vendor switch <id|name> # change the default for future commands |
| 40 | +forgebit licenses list --vendor <id|name> # target one vendor for a single call |
| 41 | +``` |
| 42 | + |
| 43 | +`--vendor` never lets the CLI act as a vendor it doesn't already hold a credential for — it only selects among ones you've logged into. |
| 44 | + |
| 45 | +## Licenses |
| 46 | + |
| 47 | +``` |
| 48 | +forgebit licenses issue --product-id <id> --customer-email you@example.com \ |
| 49 | + --tier pro --duration-type trial --license-type jwt |
| 50 | +
|
| 51 | +forgebit licenses list |
| 52 | +forgebit licenses show <license-id> |
| 53 | +forgebit licenses verify <key> |
| 54 | +forgebit licenses revoke <license-id> --reason "chargeback" |
| 55 | +forgebit licenses renew <license-id> --duration 30_days |
| 56 | +``` |
| 57 | + |
| 58 | +Every `licenses` command accepts `--json` for scripting. |
| 59 | + |
| 60 | +### Offline verification |
| 61 | + |
| 62 | +`jwt` and `forgebit`-type keys are signed with the vendor's Ed25519 key and can be verified with zero network calls — useful for embedding in a product's own license check: |
| 63 | + |
| 64 | +``` |
| 65 | +forgebit licenses public-key --vendor-id <id> --out vendor.pem |
| 66 | +forgebit licenses verify <key> --offline --public-key vendor.pem |
| 67 | +``` |
| 68 | + |
| 69 | +`serial`, `hmac`, `hwid`, and `encfile`-type keys aren't self-describing and still require the online check. |
| 70 | + |
| 71 | +## Development |
| 72 | + |
| 73 | +``` |
| 74 | +go build ./... |
| 75 | +go vet ./... |
| 76 | +go test ./... |
| 77 | +gofmt -l . |
| 78 | +``` |
| 79 | + |
| 80 | +## License |
| 81 | + |
| 82 | +[MIT](LICENSE) |
0 commit comments