Skip to content

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

15 Commits

Folders and files

Repository files navigation

Typing SVG
Sub typing



License: MIT Platform API GitHub stars GitHub last commit


Tech stack icons

What is Portable AI?

Portable AI(随身AI)是一款 自带 API Key 的移动端 AI 调用工具。它不依赖任何第三方臃肿的应用,让你用自己购买的 API 服务,在手机上随时随地与 AI 对话、写代码、调试接口。

Your API keys. Your rules. No middleman.

graph LR
    A["Configure<br/>API Key"] --> B["Choose<br/>Model"]
    B --> C["Chat with<br/>AI"]
    C --> D["Write &<br/>Run Code"]
    C --> E["Attach<br/>Images"]
    C --> F["Test<br/>APIs"]
    D --> G["Monaco<br/>Editor"]
    F --> H["403 Error<br/>Debugger"]

    style A fill:#00E0FF,stroke:#00B8D4,color:#000
    style G fill:#7C4DFF,stroke:#651FFF,color:#fff
    style H fill:#FF6D00,stroke:#E65100,color:#fff
Loading

Features

💬 AI Chat

  • Clean, minimal chat interface
  • Multi-conversation management with history
  • Streaming responses for real-time output
  • Markdown rendering for rich formatting
  • Copy / resend messages with one tap

⚙️ Flexible API Config

  • Any OpenAI-compatible endpoint (OpenAI, DeepSeek, SiliconFlow, etc.)
  • Custom API key, base URL, and model name
  • Multiple provider profiles — switch instantly
  • No data leaves your device

📝 Built-in Code Editor

  • Monaco Editor (same engine as VS Code)
  • Multi-language support (JS, TS, Python, C++, etc.)
  • Install & manage NPM packages on the fly
  • Run code directly in the browser
  • AI-powered code assistance via prompt

📸 Image & Camera

  • Attach images from gallery
  • Take photos with camera
  • Send images to vision-capable models
  • Multi-image support per message

🔌 API Debugging Tool

  • Built-in 403 error diagnosis helper
  • Test custom headers and request bodies
  • List available models from your provider
  • Connection health check

🌐 Claude Code Bridge

  • Remote Claude Code CLI monitoring via WebSocket
  • Send commands from your phone to your PC
  • Auth token security + heartbeat
  • Works through cloudflared tunnel

Quick Start

1. Install (Android)

This is a hybrid app built with HBuilder. You can:

  • Download the .apk from Releases (coming soon)
  • Or build from source using HBuilderX

2. Configure Your API

Open Settings ⚙️ and fill in:

Field Example Required
API Endpoint https://api.openai.com Yes
API Key sk-your-key-here Yes
Model gpt-4o-mini Yes

Supports any OpenAI-compatible API — DeepSeek, SiliconFlow, Groq, Ollama, etc.

3. Start Chatting

That's it. Open the app, type your message, and hit send.


Claude Code Bridge (Remote Control)

Use your phone as a remote terminal for Claude Code on your PC:

Setup

cd claude-bridge
npm install
node server.js

Expose via Tunnel

cloudflared tunnel --url ws://localhost:8765

Connect from App

  1. Open Portable AI → Settings
  2. Enter the WebSocket URL and auth token
  3. Connect — you can now send commands to Claude Code from your phone
sequenceDiagram
    participant Phone as 📱 Phone (Portable AI)
    participant Tunnel as 🌐 Cloudflare Tunnel
    participant Bridge as 🖥️ Bridge Server
    participant Claude as 🤖 Claude Code CLI

    Phone->>Tunnel: WebSocket + Auth Token
    Tunnel->>Bridge: Forward connection
    Bridge->>Bridge: Verify token
    Bridge->>Claude: Spawn CLI process
    Phone->>Bridge: User input
    Bridge->>Claude: Forward to stdin
    Claude-->>Bridge: stream-json output
    Bridge-->>Phone: Broadcast response
Loading

Code Editor

The built-in editor provides a lightweight coding environment right on your phone:

  • Editor: Monaco Editor with syntax highlighting
  • Languages: JavaScript, TypeScript, Python, C/C++, Java, HTML, CSS, and more
  • Packages: Install any NPM package and use it immediately
  • Run: Execute code and see output in real-time
  • AI Assist: Send your code to AI for review, refactoring, or generation

Project Structure

Portable-AI-edictor/
├── index.html              # Main chat interface
├── editor.html             # Built-in code editor (Monaco)
├── test-api.html           # API debugging & 403 diagnosis tool
├── manifest.json           # HBuilder app manifest
├── js/
│   └── plugins/
│       └── jscpp-runtime.js  # C/C++ runtime plugin
├── img/
│   ├── icons/              # App icons (48–512px)
│   └── splash/             # Splash screens (ldpi–xxhdpi)
├── claude-bridge/
│   ├── server.js           # WebSocket bridge server
│   ├── start.bat           # Windows quick start
│   ├── package.json
│   └── node_modules/
└── LICENSE                 # MIT

Environment Variables (Bridge Server)

Variable Required Default Description
PORT No 8765 WebSocket server port
AUTH_TOKEN No auto-generated Authentication token

Tech Stack

Category Technology
App Framework HBuilder (Hybrid App)
Chat UI Vanilla HTML/CSS/JS
Code Editor Monaco Editor
Bridge Server Node.js + ws (WebSocket)
Tunnel Cloudflare Tunnel
Design Minimal, monochrome, mobile-first

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'feat: add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

MIT


Back to Top   |   Built with ❤️, by Sfrui



Footer typing

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages