定义:
A CLI (command-line interface) is a text-based way to use software: you type a command in a terminal, and the program replies in text. For mobile teams, a CLI lets developers and AI coding agents set up, check and script tools, such as an SDK integration, without clicking through a dashboard.
What Is a Command-Line Interface (CLI)?
A command-line interface is a program you control by typing commands instead of clicking buttons. You open a terminal, type a short instruction such as tenjin doctor, and the program runs it and prints the result as text.
Most software offers a graphical user interface (GUI): windows, menus and forms built for human eyes. A CLI offers the same capabilities as plain text. That makes it a little less welcoming the first time, and much easier to repeat, automate and check afterwards.
How Does a CLI Work?
A CLI reads one line of text, runs it, and answers in text. Each command follows the same pattern, so once you know a few, the rest are easy to guess.
A typical command has three parts:
- The program: the tool you are calling, for example
tenjin - The command: what you want it to do, for example
doctor - Flags or options: how to do it, for example
--deviceto check a connected phone instead of the files on disk
Put together, tenjin doctor --device asks the Tenjin CLI to read the logs from a connected device and report whether Tenjin received and processed the install.
Because the input and output are both text, a CLI also works without anyone watching. Commands can run inside scripts and continuous integration (CI) pipelines, return machine-readable output such as JSON, and end with an exit code that tells the next step whether everything passed.
What Is the Difference Between a CLI and a GUI?
A CLI and a GUI can do the same job; they differ in who and what can use them comfortably.
| CLI | GUI | |
| How you use it | Type commands in a terminal | Click through screens and forms |
| 适合对象 | Setup, checks, repeatable tasks, automation | Exploring data visually, sharing with non-technical teammates |
| Works for AI agents | Yes, text in and text out | Poorly, agents have to read screens and guess where to click |
| Easy to audit | Yes, every command and result can be logged | Harder, clicks leave little record |
Neither replaces the other. The dashboard is still the better place to explore performance data; the terminal is the better place to set things up and prove they work.
Why Do AI Coding Agents Use CLIs?
AI coding agents such as Claude Code, Codex and Gemini CLI work in text, so a CLI is the most direct way for them to use a tool. An agent can run a command, read the answer and decide what to do next, with no screenshots and no guessing where a button is.
This matters for SDK integrations. Without a clear interface, an agent improvises from documentation, and a wrong integration often fails quietly: nothing breaks in the build, but installs never show up. A CLI gives the agent, and the person reviewing its work, a way to check the result instead of trusting it.
How Is a CLI Different from an API or an MCP Server?
All three let software talk to a platform without a dashboard, but each fits a different job.
- API 应用程序接口: a set of rules for programs to exchange data. Developers call it from their own code.
- MCP服务器: connects AI assistants to a platform's data through the Model Context Protocol, so you can ask questions about performance in plain language.
- CLI: a tool you or your agent run in the terminal, well suited to setup, checks and automation inside a project.
At Tenjin, the MCP server is for querying your data, and the CLI is for integrating the SDK and confirming it works.
How Does Tenjin Use a CLI?
该 Tenjin CLI helps you set up, check and verify a Tenjin SDK integration from the terminal, by hand or with a coding agent. It runs on macOS, Linux and Windows and supports native iOS, native Android, Flutter, React Native, Capacitor and Unity.
It works in four steps:
- Detect: reads your project's framework, platforms, bundle IDs and ad SDKs
- Set up:
tenjin setupsigns you in through the browser, finds or creates your Tenjin apps and validates your SDK keys - Check:
tenjin doctorinspects the integration on disk, including Android permissions and iOS tracking and SKAdNetwork settings, and names the file and line for each fix - Verify:
tenjin doctor --deviceconfirms that Tenjin received and processed a real 安装量 from a connected device
The Tenjin CLI never writes your integration code. Your coding agent writes it, and the CLI checks the work. Agents only ever see a placeholder for your SDK key, and the CLI shows keys by their last four characters only.
The Tenjin CLI is open source under the MIT licence. To install it on macOS or Linux with Homebrew, run brew install tenjin/tap/tenjin. Every install option is listed in the Tenjin CLI README on GitHub.
相关术语
常见问题解答
What does CLI stand for?
CLI stands for command-line interface. It is a way to use software by typing commands in a terminal and reading the results as text, instead of clicking through a graphical interface.
What is the difference between a CLI and a terminal?
The terminal is the window where you type. A CLI is the program you talk to from inside it. One terminal can run many CLIs, such as git, Homebrew or the Tenjin CLI.
Do I need to be a developer to use a CLI?
It helps to be comfortable in a terminal, but most tasks take a handful of commands. Guided commands such as tenjin setup walk you through each step and explain what they find.
Does Tenjin have a CLI?
Yes. The Tenjin CLI helps you set up, check and verify your Tenjin SDK integration from the terminal, and confirms on a real device that Tenjin processed the install. It is open source under the MIT licence.
Can AI coding agents use the Tenjin CLI?
Yes. Run tenjin agent install to set up coding agents such as Claude Code, Codex, Cursor, Copilot and Gemini CLI. The agent writes the integration code, and the Tenjin CLI checks it independently.
Does the Tenjin CLI write my integration code?
No. The Tenjin CLI detects your project, validates your keys and checks the integration, but the code is written by you or your coding agent. Keeping the two apart means the tool that verifies the work is not the one doing it.