Tina4

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:

bash
curl -fsSL https://tina4.com/install.sh | sh

Windows PowerShell:

powershell
irm https://tina4.com/install.ps1 | iex

Check the installed version:

bash
tina4 --version

Command map#

CommandPurpose
tina4 setupRun guided setup and create a ready-to-run project.
tina4 initCreate a project for Python, PHP, Ruby, Node.js, or tina4-js.
tina4 serveStart the detected framework with file watching and SCSS compilation.
tina4 doctorReport installed runtimes, package managers, and Tina4 tools.
tina4 installInstall a supported language runtime.
tina4 scssCompile SCSS into CSS.
tina4 buildBuild production front-end assets.
tina4 deployGenerate Docker, systemd, nginx, or cPanel deployment files.
tina4 envInspect, migrate, and synchronize environment variables.
tina4 metricsMeasure production source and rank code-health findings.
tina4 aiDetect coding assistants and install Tina4 context.
tina4 skillsInstall current Tina4 skills for Claude, Codex, Cursor, or all three.
tina4 docsDownload framework documentation into .tina4-docs/.
tina4 booksDownload the matching Tina4 book.
tina4 agentStart the Code With Me agent server.
tina4 updateUpdate the signed client and refresh installed skills.

Run tina4 <command> --help for the command's current arguments and options.

Start a project#

One command creates the project. One command runs it.

bash
tina4 init python my-appcd my-apptina4 serve

Replace 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:

bash
tina4 serve my-app

Common server options:

OptionPurpose
-p, --port <PORT>Override the framework's default port.
--host <HOST>Bind to another address. The default is 0.0.0.0.
--devForce the development server.
--productionInstall and use the preferred production server.
--no-browserDo not open a browser after startup.
--no-reloadDisable 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:

bash
tina4 metrics

Scan an explicit source directory and show the ten highest-ranked findings:

bash
tina4 metrics --path src --top 10

The 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#

OptionPurpose
--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.
--jsonEmit the machine contract used by dev-admin and CI.
--fail-on warnExit with code 1 for warning or error findings.
--fail-on errorExit with code 1 for error findings.
--exclude <GLOB>Exclude a path. Repeat the option for more paths.
--include-non-productionInclude tests, specs, and declaration files.

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:

bash
tina4 metrics --exclude '**/dev_admin/**' --exclude '**/gallery/**'

CI gate#

Use JSON for stored reports and --fail-on for the gate:

bash
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.

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.

Manage environment variables#

The client can list the variables that source code uses, generate .env.example, synchronize missing entries, and migrate legacy unprefixed names.

bash
tina4 env --listtina4 env --exampletina4 env --synctina4 env --migrate

Migration creates .env.bak before it writes the canonical TINA4_* names. Use --yes to skip confirmation in CI.

Keep tools current#

bash
tina4 updatetina4 skills alltina4 doctor

The update command refreshes the signed binary and installed Tina4 skills. The doctor command then shows which runtimes and framework clients are ready.