@taplid/cli
v0.1.11
Published
Official CLI for the hosted Taplid audit API.
Downloads
954
Maintainers
Readme
@taplid/cli
Official CLI for the hosted Taplid audit API.
Use it as a thin hosted-service wrapper.
- Docs: https://taplid.com/setup
- Playground: https://taplid.com/playground/audit
Usage
npx @taplid/cli audit request.jsonIf you install the package locally use:
taplid audit request.jsonInput
If provided, the input file contains the same request payload used by the playground and API.
Example request.json:
{
"context": "Support access policy:\n1. Support agents cannot view an existing password.\n2. Users must use the password reset flow to regain access.",
"prompt": "Can support tell me my current password?",
"response": "You can update your billing address in Settings > Billing."
}Only response is required; context, prompt, and audit_mode are optional.
Example response.json:
{
"decision": "BLOCK",
"trustScore": 30,
"summary": "High-risk reliability issues found. Do not use as-is.",
"issues": [
{
"message": "Does not fully answer the request.",
"reason": "Important parts of the request are missing."
},
{
"message": "Includes unsupported or unverifiable claims.",
"snippet": "You can update your billing address in Settings > Billing.",
"reason": "Key claim is not backed by a source."
}
],
"nextStep": "Do not use this output yet. Rewrite it with better support and review it again.",
"details": {
"reviewThreshold": 60,
"passThreshold": 80
}
}Output
By default the CLI writes the full audit result JSON to a sibling file:
- Input — request.json
- Output — request.response.json
When no input file is provided, default output is ./taplid.response.json.
Optional Flags
npx @taplid/cli audit request.json --out custom-response.json
npx @taplid/cli audit --response "Inline response only"
npx @taplid/cli audit --response-file-location ./bundle/response.txt
npx @taplid/cli audit --prompt "Inline prompt" --response-file-location ./bundle/response.txt
npx @taplid/cli audit request.json --deep
npx @taplid/cli audit request.json --audit-mode artifact
npx @taplid/cli audit request.json --api-url http://127.0.0.1:7000
npx @taplid/cli audit request.json --api-key your_api_key
npx @taplid/cli audit request.json --env-file .env.taplid
npx @taplid/cli audit request.json --pass-threshold 85 --review-threshold 65--out <path>writes the response JSON to a custom output path.--context <text>sets request context text for this run.--prompt <text>sets request prompt text for this run.--response <text>sets request response text for this run.--context-file-location <path>resolves context text from a file.--prompt-file-location <path>resolves prompt text from a file.--response-file-location <path>resolves response text from a file.--deepforcesdeepAudit: truefind issues the standard audit may miss.--audit-mode <artifact>overridesaudit_modefor this run.--api-url <url>overrides the default API origin.--api-key <key>is required and sends the taplid.com account API key.--env-file <path>loads TAPLID env defaults from an explicit env file.--pass-threshold <0-100>overrides the pass threshold for this run.--review-threshold <0-100>overrides the review threshold for this run.
Optional Environment Loading
The CLI supports three ways of providing TAPLID env values:
- Shell or process environment
- Explicit
--env-file <path> - Auto-loaded local
.envfrom the current working directory
If --env-file is provided, the CLI loads that file and does not auto-load the local .env.
If --env-file is not provided, the CLI checks process.cwd() for .env and continues silently if the file is absent.
If --env-file is provided but the file does not exist, the CLI fails fast.
Example shell usage:
$env:TAPLID_AUDIT_MODE = "artifact"
npx @taplid/cli audit request.jsonExample explicit env file usage:
npx @taplid/cli audit request.json --env-file .env.taplidOptional Environment Defaults
Supported variables:
TAPLID_API_URL=TAPLID_API_KEY=TAPLID_CONTEXT=TAPLID_PROMPT=TAPLID_RESPONSE=TAPLID_CONTEXT_FILE_LOCATION=TAPLID_PROMPT_FILE_LOCATION=TAPLID_RESPONSE_FILE_LOCATION=TAPLID_AUDIT_MODE=TAPLID_DEEP_AUDIT=TAPLID_REVIEW_THRESHOLD=TAPLID_PASS_THRESHOLD=
context, prompt, and response are resolved per field as: CLI -> env/defaults -> request.json.
Within each layer, inline text wins over matching *FileLocation.
TAPLID_CONTEXT/TAPLID_PROMPT/TAPLID_RESPONSE override matching TAPLID_*_FILE_LOCATION values in the env layer.
contextFileLocation, promptFileLocation, and responseFileLocation read file content as raw UTF-8 text regardless of extension (.txt, .json, etc.).
request.json *FileLocation paths resolve from the request file directory, --env-file paths resolve from the env-file directory, and direct CLI/process-env paths resolve from process.cwd().
Precedence
- text fields (
context,prompt,response): CLI -> env/defaults ->request.json - non-text fields: CLI flags ->
request.json-> shell env ->--env-file-> local.env-> built-in defaults
File format handling for context, prompt, and response inputs
Taplid treats context, prompt, and response file inputs as raw UTF-8 text. Supported examples include .txt, .md, .json, .log, .ndjson, .yaml, and .yml. These files are not parsed by type. Taplid reads the file contents as plain text and uses the resolved text value. This behavior is consistent across the playground, CLI file-location flags, environment file-location variables, and request-payload file-location fields.
Relative file-location paths resolve from:
request.jsondirectory for request payload file-location fields--env-filedirectory for env-file defaultsprocess.cwd()for direct CLI flags and process environment values
If an explicit file-location path is provided and the file cannot be read, the CLI fails with a clear error unless an inline value for the same field is provided in that same layer.
