Content
# upstage-cli
[](LICENSE)
[](https://nodejs.org)
> **This is an unofficial, community-driven project.**
> It is not affiliated with, endorsed by, or maintained by [Upstage AI, Inc.](https://upstage.ai)
> All trademarks belong to their respective owners.
This is a CLI tool that allows you to use Upstage AI's document processing API from the terminal.
It is designed to be used as a tool for AI coding agents (Claude Code, OpenCode, Cursor, etc.).
It wraps the same API of the official MCP server ([UpstageAI/mcp-upstage](https://github.com/UpstageAI/mcp-upstage)) as a CLI, allowing agent tool calls with fewer tokens compared to MCP.
## Commands
| Command | Description |
|---------|-------------|
| `upstage parse <file>` | Convert document to Markdown/HTML/text |
| `upstage ocr <file>` | Extract text from image/scanned document |
| `upstage extract <file>` | Extract information based on JSON schema |
| `upstage schema <files...>` | Automatically generate JSON schema from sample documents |
| `upstage classify <file>` | Classify document into categories |
| `upstage embed <text>` | Generate text embedding vector |
| `upstage install --skills` | Install skill files for AI agent + set API key |
| `upstage config set-key` | Change API key |
| `upstage config show` | Check current settings |
| `upstage config reset` | Reset saved settings |
## Requirements
- [Node.js](https://nodejs.org) 18+
- [Upstage API Key](https://console.upstage.ai) (Free Sign-Up)
## Installation
```bash
git clone https://github.com/myeolinmalchi/upstage-cli.git
cd upstage-cli
npm install && npm run build
npm link
```
## Setup
After installation, run the initial setup in your project:
```bash
cd my-project
upstage install --skills
```
This command does two things:
1. **Set API Key** — If there is no key, it will ask for input and save it to `~/.config/upstage-cli/config.json`
2. **Install Skills** — Copy `.claude/skills/upstage/SKILL.md` to the project
The installed skills work with any agent that supports the [Agent Skills](https://agentskills.io) standard:
- **Claude Code** — Auto-discovery, can be called with `/upstage`
- **OpenCode** — `.claude/skills/` compatible support
- **Cursor, Gemini CLI, GitHub Copilot**, etc.
Even without skills, the agent can run `upstage --help` to understand how to use it.
### API Key Management
```bash
upstage config set-key # Enter key (interactive)
upstage config set-key up_xxx # Specify key directly
upstage config show # Check current settings
upstage config reset # Delete saved key
```
If the environment variable `UPSTAGE_API_KEY` is set, it takes precedence over the config file.
## Usage
### Document Parsing
```bash
upstage parse ./report.pdf
upstage parse ./slides.pptx --format html
upstage parse ./data.xlsx --mode enhanced
```
### OCR
```bash
upstage ocr ./screenshot.png
upstage ocr ./scanned.pdf
```
### Information Extraction
```bash
upstage extract ./receipt.pdf -s '{"type":"object","properties":{"total":{"type":"number"}}}'
upstage extract ./invoice.pdf -s @schema.json
```
### Schema Generation
```bash
upstage schema ./sample1.pdf ./sample2.pdf
```
### Document Classification
```bash
upstage classify ./doc.pdf -c "invoice,receipt,contract,resume"
```
### Text Embedding
```bash
upstage embed "유사한 문서를 찾아주세요"
upstage embed "문서 내용..." --type passage
```
### Raw JSON Output
Add the `--json` flag to any command to output the original API response.
```bash
upstage parse ./file.pdf --json
```
## Development
```bash
npm install
npm run dev -- parse ./file.pdf # Run directly with tsx
npm run build # Compile TypeScript
npm test # Test (TODO)
```
## Project Structure
```
├── skills/
│ └── upstage/
│ └── SKILL.md # Agent Skills (included in deployment)
├── src/
│ ├── cli.ts # CLI entry point
│ ├── client.ts # Upstage API HTTP client
│ ├── config.ts # API key and settings management
│ └── commands/
│ ├── parse.ts # document parse
│ ├── ocr.ts # OCR
│ ├── extract.ts # information extraction
│ ├── schema.ts # schema generation
│ ├── classify.ts # document classification
│ ├── embed.ts # text embedding
│ ├── install.ts # Install skill + set API key
│ └── config.ts # API key management
├── package.json
└── .npmignore # Only skills/** is included in deployment
```
## Contributing
Issues and Pull Requests are welcome.
1. Fork this repository
2. Create your branch (`git checkout -b feature/amazing`)
3. Commit your changes
4. Push and open a Pull Request
## License
[MIT](LICENSE)
---
> This project is not affiliated with Upstage AI, Inc.
> Built with the publicly available [Upstage API](https://developers.upstage.ai).
Connection Info
You Might Also Like
n8n
n8n is a workflow automation platform for technical teams, combining code...
ollama
Get up and running with OpenAI gpt-oss, DeepSeek-R1, Gemma 3 and other models.
dify
Dify is a platform for AI workflows, enabling file uploads and self-hosting.
open-webui
Open WebUI is an extensible web interface for various applications.
NextChat
NextChat is a light and fast AI assistant supporting Claude, DeepSeek, GPT4...
zed
Zed is a high-performance multiplayer code editor from the creators of Atom.
Cline
Cline is a versatile tool available on VS Marketplace for enhancing...
anything-llm
AnythingLLM: An all-in-one AI app for chatting with documents and using AI agents.
cherry-studio
🍒 Cherry Studio is a desktop client that supports for multiple LLM providers.
chatbox
User-friendly Desktop Client App for AI Models/LLMs (GPT, Claude, Gemini, Ollama...)