@j4k-oss/tropkod-client (1.0.0)
Installation
@j4k-oss:registry=npm install @j4k-oss/tropkod-client@1.0.0"@j4k-oss/tropkod-client": "1.0.0"About this package
@j4k-oss/tropkod-client
Stateless CLI client for the tropkod dependency-analysis API. It submits one natural-language question about a public npm or crates.io dependency, waits for the hosted service to analyze it against the dependency's real source, and prints the grounded answer.
The client holds no state: it opens no local store, spawns no agent, and inspects no source. It only sends HTTP requests to a tropkod service and renders the response.
Install
The package is published to the code.j4k.dev registry under the @j4k-oss scope, which allows anonymous reads (no token needed):
npm config set @j4k-oss:registry https://code.j4k.dev/api/packages/j4k-oss/npm/
npm i -g @j4k-oss/tropkod-client
Authentication
Requests need a service URL and an API key. Keys are provisioned manually — there is no self-serve signup. Set both (or pass --url / --api-key):
export TROPKOD_URL=https://api.tropkod.ai
export TROPKOD_API_KEY=<provisioned-key>
TROPKOD_URL has no default: every request requires --url or TROPKOD_URL, otherwise the client exits with requests require --url or TROPKOD_URL. The hosted deployment is https://api.tropkod.ai; point at a self-hosted service with its own URL.
Usage
tropkod-client "Does npm:fastify@5.6.0 expose schemaCompiler?"
Name the dependency inline as npm:<package>@<version> or crate:<name>@<version>.
Read the question from stdin when no positional argument is given and stdin is not a terminal:
echo "Does crate serde@1.0.197 expose Deserialize?" | tropkod-client
JSON output
--json prints the full submission envelope. Combine with jq for scripting:
tropkod-client "Does npm:zod@4 expose z.url?" --json | jq -r '.analysis.status'
Polling long analyses
Submit without waiting (--wait-ms 0), then poll by job id:
tropkod-client --wait-ms 0 "Does npm:fastify@5.6.0 expose schemaCompiler?"
tropkod-client --job <job-id>
Re-run tropkod-client --job <job-id> until the job completes (exit 0) or fails (exit 1).
Flags
| Flag | Env fallback | Default | Notes |
|---|---|---|---|
--url <url> |
TROPKOD_URL |
none (required) | tropkod service URL; the hosted deployment is https://api.tropkod.ai |
--api-key <key> |
TROPKOD_API_KEY |
none (required) | Provisioned manually |
--session <id> |
— | — | Reuse a session for follow-up questions |
--job <id> |
— | — | Fetch an existing job instead of submitting |
--wait-ms <ms> |
— | 120000 |
Synchronous wait budget; 0 submits without waiting. The server rejects values above 300000 |
--json |
— | false |
Print the full JSON envelope |
Pass either a question or --job, not both. --session and --wait-ms apply only to submissions; when --job is given they are ignored.
Exit codes
| Code | Meaning |
|---|---|
0 |
Job completed — both answered and unresolved analyses exit 0 |
1 |
Job failed, or the request itself errored (bad input, timeout, network, HTTP error) |
2 |
Job still pending or running |
Scripts that must distinguish an answered result from an unresolved one should use --json and inspect analysis.status.
Agent Rule
Reach for tropkod-client when you need to check a claim about a public npm or crates.io dependency ("does fastify@5.6.0 expose schemaCompiler?") against the dependency's real source rather than guessing from memory or package metadata. Run tropkod-client --help before first use to confirm the current flags, then submit one inline-named question (npm:<pkg>@<version> or crate:<name>@<version>) and read --json output for a scriptable verdict. It needs TROPKOD_URL and TROPKOD_API_KEY in the environment.
Development
This repo lints with @j4k/oxlint-config, which is published only to the code.j4k.dev registry under the private @j4k scope. pnpm install therefore needs a code.j4k.dev read token even though the repository is public:
npm config set //code.j4k.dev/api/packages/j4k/npm/:_authToken "$FORGEJO_NPM_TOKEN"
pnpm install
pnpm test
pnpm lint
pnpm typecheck
pnpm build
License
MIT. See LICENSE.
Dependencies
Dependencies
| ID | Version |
|---|---|
| @commander-js/extra-typings | ^15.0.0 |
| commander | ^15.0.0 |
| zod | ^4.4.3 |
Development dependencies
| ID | Version |
|---|---|
| @j4k/oxlint-config | ^2.11.0 |
| @j4k/semantic-release-forgejo | ^1.2.1 |
| @total-typescript/ts-reset | ^0.6.1 |
| @types/node | ^25.9.2 |
| @vitest/coverage-v8 | ^4.1.8 |
| fta-check | ^1.5.2 |
| fta-cli | ^3.0.0 |
| knip | ^6.16.1 |
| oxfmt | ^0.57.0 |
| oxlint | ^1.72.0 |
| oxlint-tsgolint | ^0.23.0 |
| semantic-release | ^25.0.7 |
| typescript | ^7.0.2 |
| vitest | ^4.1.8 |