We wanted to embed CLI Agents as part of our product, so we investigated the licenses of tools from three major AI platformers. This article explains the commercial use possibilities for each tool and key points to consider when integrating them.
We investigated the following three CLI Agent tools:
In conclusion, the license types fall into two categories.
| Tool | License | Commercial Use | Source Modification | Redistribution | Patent Clause |
|---|---|---|---|---|---|
| Claude Code | Proprietary | Conditional | ❌ | ❌ | None |
| Codex | Apache 2.0 | ✅ | ✅ | ✅ | Yes |
| Gemini CLI | Apache 2.0 | ✅ | ✅ | ✅ | Yes |
Codex and Gemini CLI are provided under Apache 2.0, an open source license suitable for commercial use. On the other hand, only Claude Code has a proprietary license, and code modification and redistribution are generally prohibited.
Although Claude Code’s source code is published on GitHub, this does not mean it is “open source.” The LICENSE file contains the following:
© Anthropic PBC. All rights reserved.
Use is subject to Anthropic's Commercial Terms of Service.
While “using” Claude Code itself is possible by agreeing to the commercial terms of service, “embedding” or “modifying” it for your own product is generally not permitted.
Using Anthropic’s “Agent SDK” to invoke Claude Code’s CLI as a subprocess is presented as an “approved integration path.” However, even with SDK integration, designs that allow end users to directly use their own Claude.ai login credentials or rate limits risk violating the terms unless prior approval is obtained from Anthropic.
For commercial users, ownership of Outputs belongs to the customer. Anthropic also provides indemnification against copyright infringement claims for commercial customers.
Both OpenAI Codex and Google Gemini CLI adopt Apache License 2.0. This license, like MIT, is permissive and suitable for commercial use.
The most significant feature is the inclusion of an explicit patent grant clause. Contributors grant a perpetual, worldwide, royalty-free license for patents related to their contributions. This reduces the risk of patent infringement lawsuits.
| Requirement | Details |
|---|---|
| Include License | Include the full Apache 2.0 license text in your product |
| State Changes | Clearly indicate modifications in changed files |
| Preserve Copyright | Maintain original copyright, patent, and attribution notices |
| NOTICE File | Include in derivative works if present |
Apache 2.0 contains a patent retaliation clause. If you file a patent lawsuit against software covered by Apache 2.0, the patent license for that software is automatically terminated. Companies with significant patent strategies should consider this clause.
Section 6 of the license does not permit using trademarks such as “OpenAI,” “Codex,” “Google,” or “Gemini” in product names or marketing. Trademark use beyond describing the product’s origin requires separate permission.
Importantly, the software license and AI API service terms of service are separate matters. Even if the software itself is open source, each company’s terms apply to backend API usage.
| Tool | API Provider | Applicable Terms |
|---|---|---|
| Claude Code | Anthropic API | Anthropic Commercial Terms of Service |
| Codex | OpenAI API | OpenAI Business Terms |
| Gemini CLI | Google Gemini API | Gemini API Terms of Service |
Notably, OpenAI Business Terms restricts “using Output to develop AI models that compete with OpenAI.” Gemini API and Anthropic API also have their respective Usage Policies prohibiting illegal or harmful use.
Beyond the three tools from major AI platformers above, many other OSS CLI Agent tools are available for commercial use.
| Tool | Description |
|---|---|
| Aider | CLI tool for AI pair programming in the terminal |
| ForgeCode | Interactive CLI pair programming tool supporting multiple LLM providers |
| Goose | Highly extensible on-machine AI agent developed by Block |
| Tool | Description |
|---|---|
| OpenCode | Provider-agnostic, supporting 75+ models. Avoids lock-in to specific providers |
| Plandex | Terminal-based AI development tool designed for large-scale projects |
All of these are available for commercial use.
Note that the MIT License does not include an explicit patent grant clause, so patent infringement protection is weaker than Apache 2.0.
Legal risk is low and required actions are minimal. Simply including copyright notices and license text in your product allows free commercial use, modification, and redistribution.
In particular, OpenCode (MIT) is designed to be provider-agnostic, enabling “model routing” where you can use different models based on task difficulty. Combining inexpensive and high-performance models enables cost optimization. Note that MIT License lacks patent protection.
With patent grant clauses, these are suitable for business environments. As long as you properly meet attribution and change notification requirements, integration into proprietary products is acceptable. Don’t forget to check for NOTICE files.
For coding purposes, both Codex and Gemini CLI are viable options. For enterprise customers, combining Google Cloud Vertex AI with Gemini CLI, or OpenAI Enterprise with Codex, is appropriate. These combinations clear data residency and compliance certifications (SOC 2, etc.), minimizing sales barriers.
On the other hand, for general-purpose use cases (content generation, research, task management, etc.), Gemini CLI is the clear choice. Gemini CLI is designed to handle a wide range of tasks beyond coding, and supports script integration and batch processing through Headless Mode.
Since code modification and redistribution are prohibited, integration into your own product is essentially not possible.
If you want to leverage Claude AI capabilities, consider the following approaches:
Agentic AI consumes significantly more tokens compared to simple chat-based AI. This is because each request sends the codebase structure, file contents, past execution results, and complex system prompts as context.
When designing commercial products, the choice of cost model directly impacts profitability:
If your goal is to integrate as part of your own product, Codex/Gemini CLI (Apache 2.0) or OSS CLI Agents like OpenCode (MIT) are appropriate. Both have commercial-friendly licenses, and as long as proper attribution is provided, integration into proprietary software is permitted.
Although Claude Code’s source code is published, its proprietary license makes it unsuitable for integration use. If you want to leverage Claude AI capabilities, consider using it via API.
For final adoption decisions, we recommend confirming the following:
That’s all from the Gemba on investigating CLI Agent tool licenses.