Tina4 CLI reference#
The Tina4 client is one signed binary for Python, PHP, Ruby, Node.js, and tina4-js. It creates projects, starts servers, manages local tooling, and measures source code without loading a framework runtime.
Install the client#
macOS and Linux:
curl -fsSL https://tina4.com/install.sh | shWindows PowerShell:
irm https://tina4.com/install.ps1 | iexCheck the installed version:
tina4 --versionCommand map#
| Command | Purpose |
|---|---|
tina4 setup | Run guided setup and create a ready-to-run project. |
tina4 init | Create a project for Python, PHP, Ruby, Node.js, or tina4-js. |
tina4 serve | Start the detected framework with file watching and SCSS compilation. |
tina4 doctor | Report installed runtimes, package managers, and Tina4 tools. |
tina4 install | Install a supported language runtime, tina4-js, or CodeQL. |
tina4 scss | Compile SCSS into CSS. |
tina4 build | Build production front-end assets. |
tina4 deploy | Generate Docker, systemd, nginx, or cPanel deployment files. |
tina4 env | Inspect, migrate, and synchronize environment variables. |
tina4 metrics | Measure production source and rank code-health findings. |
tina4 codeql | Run CodeQL locally before CI and exit on any security finding. |
tina4 ai | Detect coding assistants and install Tina4 context. |
tina4 skills | Install current Tina4 skills for Claude, Codex, Cursor, or all three. |
tina4 docs | Download framework documentation into .tina4-docs/. |
tina4 books | Download the matching Tina4 book. |
tina4 update | Update the signed client and refresh installed skills. |
tina4 uninstall | Remove the client, its config and credentials, and the installed skills from this machine. |
Run tina4 <command> --help for the command's current arguments and options.
Start a project#
One command creates the project. One command runs it.
tina4 init python my-appcd my-apptina4 serveReplace python with php, ruby, nodejs, or js. The js option creates a tina4-js front-end project.
tina4 serve detects the framework from the project files. You can also name a configured project from another directory:
tina4 serve my-appCommon server options:
| Option | Purpose |
|---|---|
-p, --port <PORT> | Override the framework's default port. |
--host <HOST> | Bind to another address. The default is 0.0.0.0. |
--dev | Force the development server. |
--production | Install and use the preferred production server. |
--no-browser | Do not open a browser after startup. |
--no-reload | Disable the file watcher's reload signal. |
Measure code health#
tina4 metrics reads source files directly. It does not start the application or import the framework. One native engine applies the same formulas to Python, PHP, Ruby, TypeScript/JavaScript, and Rust.
Run it from a project:
tina4 metricsScan an explicit source directory and show the ten highest-ranked findings:
tina4 metrics --path src --top 10The report measures lines of code, cyclomatic complexity, maintainability, coupling, function count, duplicate blocks, and test-reference evidence. It reports evidence that a test refers to a source file. It does not claim that the test ran, passed, or covered each branch.
Metrics options#
| Option | Purpose |
|---|---|
--path <PATH> | Scan one directory or file. Without it, the client detects the source root. |
--top <N> | Limit the displayed ranked list. The default is 20. Totals stay unchanged. |
--json | Emit the machine contract used by dev-admin and CI. |
--fail-on warn | Exit with code 1 for warning or error findings. |
--fail-on error | Exit with code 1 for error findings. |
--exclude <GLOB> | Exclude a path. Repeat the option for more paths. |
--include-non-production | Include tests, specs, and declaration files. |
--no-history | Do not read or write the run-history baseline for this scan. |
Production scans ignore conventional tests, specs, generated bundles, minified assets, declarations, dependencies, build output, caches, and version-control data. Use explicit exclusions for project-specific production trees:
tina4 metrics --exclude '**/dev_admin/**' --exclude '**/gallery/**'CI gate#
Use JSON for stored reports and --fail-on for the gate:
tina4 metrics --json --fail-on error > metrics.json--top changes presentation only. It never hides a finding from the exit gate. Informational no_test_reference findings do not fail warning or error gates.
Track change over time#
Every scan records a snapshot to .tina4-metrics.json in the scan root. The next scan of the same scope reads it and prints a Since last run block: offenders, duplicate lines, average maintainability, and average complexity, each marked better, worse, or same, followed by the files that improved or regressed.
tina4 metrics --path src # first run: writes the baseline# ... you refactor ...tina4 metrics --path src # second run: reports what movedThe snapshot is data, not source, so the engine never scans it. Commit it to gate regressions in review, or add it to .gitignore for a local-only baseline. The --json output carries the same comparison under a delta key. Pass --no-history to read and write nothing.
Reading offender totals#
An offender is one finding, not one file. A file can carry several findings: high function complexity, excessive size, low maintainability, duplication, and too many functions. Count unique file names when you need the size of the refactoring worklist. Count findings when you need the gate pressure.
Pre-check security with CodeQL#
tina4 codeql runs the same CodeQL scan your pull request will meet in CI, on your own machine, before you push. It reads the checkout, decides which languages are present, and hands each one to CodeQL for the GitHub "default setup (extended)" security suite. A finding shows here first, so it never has to surface as a red check later.
The command needs the CodeQL client on the path. Install it, with the query packs it depends on, in one step:
tina4 install codeqlThen run it from a project:
tina4 codeqlIt detects the language from the project files. A Node.js or tina4-js tree is scanned as JavaScript and TypeScript, a Python tree as Python, a Ruby tree as Ruby, and the GitHub Actions workflows are scanned too when .github/workflows exists. For each one the command creates a throwaway database, analyses it against the security-extended suite, and prints every finding grouped by rule with its file and line. The scan is faithful to CI: it only flags a real source-to-sink taint flow, not a plain text match.
Trace what happens to the exit code. If the scan finds nothing, the command exits 0; if it finds something, it exits with the finding count. That makes it a gate for a pre-push hook:
tina4 codeql || { echo "CodeQL found something - fix it before you push"; exit 1; }PHP is skipped. CodeQL doesn't support it, and CI scans PHP with Semgrep instead.
CodeQL options#
| Option | Purpose |
|---|---|
--path <PATH> | Scan a directory other than the detected project root. |
--language <LANG> | Scan one language. Repeat the option for more. Overrides detection. |
--no-actions | Skip the GitHub Actions workflow scan. |
Creating the database is the slow part. The Actions, Ruby, and Python databases build in seconds, while a full JavaScript and TypeScript monorepo takes a few minutes. Run it before a push or on demand, not on every commit.
tina4 doctor reports whether the CodeQL client is installed and, when it is missing, prints the install command for your operating system.
Manage environment variables#
The client can list the variables that source code uses, generate .env.example, synchronize missing entries, and migrate legacy unprefixed names.
tina4 env --listtina4 env --exampletina4 env --synctina4 env --migrateMigration creates .env.bak before it writes the canonical TINA4_* names. Use --yes to skip confirmation in CI.
Keep tools current#
tina4 updatetina4 skills alltina4 doctorThe update command refreshes the signed binary and installed Tina4 skills. The doctor command then shows which runtimes and framework clients are ready.
Remove the client#
When you are done with Tina4 the client will take itself back off the machine. tina4 uninstall first lists everything it put there: the config and credentials, the installed skills across Claude, Codex and Cursor, and the binary itself. Then it asks before it removes a single file.
tina4 uninstall # lists targets, asks, then removestina4 uninstall --dry-run # only reports what it would touchtina4 uninstall --yes # skips the prompts, for scriptsThe current project's own .tina4/, .tina4-metrics.json and .tina4-docs are offered as a separate, explicit opt-in. Nothing else on the filesystem is searched, so an uninstall never reaches into another project you forgot about.