開發者工具
AI 編程,全棧一體
TronCode 編輯器、TronCLI 終端、TronAPI 統一模型 API,三層全由 Link Astra 出品,覆蓋 IDE、命令行與 API。
Dashboard.tsx - TronCode
Explorer···
▾ TRONCODE-APP
src
components
pages
Dashboard.tsx
Settings.tsx
Login.tsx
utils
App.tsx
index.ts
public
package.json
tsconfig.json
Dashboard.tsx
Settings.tsx
src›pages›Dashboard.tsx
1import React, { useState, useEffect } from 'react';
2import { fetchMetrics } from '../utils/api';
3import { MetricCard } from '../components/MetricCard';
4
5export default function Dashboard() {
6 const [metrics, setMetrics] = useState<Metric[]>([]);
7 const [loading, setLoading] = useState(true);
8 const [error, setError] = useState<string | null>(null);
9
10 useEffect(() => {
11 // AI generated: data loading & error handling
12 const loadData = async () => {
13 try {
14 setLoading(true);
15 const data = await fetchMetrics();
16 setMetrics(data);
17 } catch (err) {
18 setError('Load failed, please retry');
19 } finally {
20 setLoading(false);
21 }
22 };
23 loadData();
24 }}, []);
25
26 if (loading) return <LoadingSpinner />;
Agent
Help me add data loading and error handling logic to the Dashboard
I've added complete data loading and error handling to the
Dashboard component:✓ Use useEffect to fetch on mount✓ Add try/catch/finally handling✓ Show LoadingSpinner during loadType a command…
@/Agent
⌘↵
main0 errors 0 warnings
Ln 14, Col 38Spaces: 2UTF-8TypeScript ReactPrettier
TronCode 核心能力
從程式碼補全到 Agent 工作流,覆蓋全開發鏈路
Agent 工作流
把跨文件改動交給 Agent,自動規劃、編寫並給出可審閲的 diff。
agent
$ agent: "extract auth into middleware"→ plan: touch 3 filessrc/middleware/auth.ts (new)src/api/route.ts (edit)✓ 12 files done · 1m 42s▋
智能补全
結合整個倉庫上下文給出補全建議,一鍵採納。
completion
def fetch_user(uid):# → AI suggests ↓return db.query(User, id==uid)▋
代码库问答
對任意符號提問,直達每一處調用與定義。
codebase
? who calls refresh_token→ 3 refs foundauth/route.ts:42middleware.ts:11cli/login.ts:8▋
MCP 集成
通過 MCP 接入外部工具,在編輯器內直接調用。
mcp
$ mcp: connect filesystem, github→ registering tools...filesystem.read_filegithub.create_issuegithub.search_code✓ 18 tools ready▋
TronCLI
終端原生的 AI 編程代理,無需打開 IDE,在命令行完成程式碼生成、重構、調試,支援 SSH 遠程與 CI/CD 集成
- 任意終端可用,無需打開 IDE
- 支援 SSH 遠程伺服器
- 可腳本化接入 CI/CD
Tron · ~/project/my-app
Tron
你好!我已分析了你的项目。检测到 TypeScript + React 项目,发现 auth.ts 缺少 token 刷新逻辑。需要我帮你添加吗?
你
@src/api/auth.ts里添加 JWT 令牌自动刷新,参考 request.ts 的拦截器写法
✓ 已读取 src/api/auth.ts (128 行)
✓ 已读取 src/utils/request.ts (64 行)
◎ 正在生成代码...
my-app
Context
18,421 tokens
12% used
$0.03 spent
LSP
TypeScript ●
ESLint ●
ESLint ●
≡Build·tron-code·streaming...
Buildtron-codemy-app
tab agents ctrl+p commands~/project/my-appTron
TronAPI
Link Astra 自研的統一模型 API,OpenAI 兼容,一個端點接入 15+ 主流模型,兩個環境變量即可開始
TronAPI · api.linkastra.ai/v1/chat
$ POST api.linkastra.ai/v1/chat
-d '{"model":"deepseek-chat"}'
-d 'write a jwt refresh function'
→ streaming code via SSE
← def refresh_token(token):
← payload = jwt.decode(token)
← if expired(payload):
← [DONE]
▋
●200 OK142 tokens$0.001streaming...
從模型 API 到編輯器到終端,貫穿你寫程式碼的每一個入口。
跨端一致
編輯器、終端、統一模型 API 同一條工具鏈,跨端一致的開發體驗,不在工具間反覆切換。
生產級
支援私有化部署、SSH 遠程、CI/CD 腳本化接入,扛得住真實工程。
統一模型 API
Link Astra 自營,一個端點、OpenAI 兼容,15+ 主流模型,DeepSeek、GLM 等即接即用。
企業就緒
MCP 工具集成、可審閲 diff、可團隊協作,滿足企業合規與審計。
準備好用 AI 寫程式碼了嗎?
選擇適合你的工具,立即體驗 AI 編程
TronCode 和 TronCLI 是 Link Astra 旗下的專業編程工具品牌