Skip to content

Commit 0f91176

Browse files
committed
[ft] : Stable version
1 parent 7e09366 commit 0f91176

File tree

6 files changed

+81
-13
lines changed

6 files changed

+81
-13
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,49 @@
11
{
2-
"name": "deepseek-cli",
2+
"name": "run-deepseek-cli",
33
"version": "0.1.0",
4-
"description": "MVP - AI coding assistant CLI powered by DeepSeek",
4+
"description": "AI-powered coding assistant CLI using DeepSeek models",
55
"main": "dist/index.js",
66
"bin": {
7-
"deepseek": "./dist/index.js"
7+
"deepseek-cli": "./dist/index.js"
88
},
9+
"files": [
10+
"dist/**/*",
11+
"README.md",
12+
"LICENSE",
13+
"package.json"
14+
],
915
"scripts": {
1016
"build": "tsc",
1117
"dev": "ts-node src/index.ts",
12-
"start": "node dist/index.js"
18+
"start": "node dist/index.js",
19+
"prepublishOnly": "npm run build",
20+
"test": "echo \"Error: no test specified\" && exit 0",
21+
"lint": "eslint src/**/*.ts",
22+
"format": "prettier --write src/**/*.ts",
23+
"type-check": "tsc --noEmit"
1324
},
14-
"keywords": ["cli", "deepseek", "ai", "coding-assistant"],
25+
"keywords": [
26+
"cli",
27+
"deepseek",
28+
"ai",
29+
"coding-assistant",
30+
"code-generation",
31+
"developer-tools",
32+
"command-line"
33+
],
34+
"author": "Your Name <your.email@example.com>",
1535
"license": "MIT",
36+
"repository": {
37+
"type": "git",
38+
"url": "https://github.com/holasoymalva/deepseek-cli.git"
39+
},
40+
"bugs": {
41+
"url": "https://github.com/holasoymalva/deepseek-cli/issues"
42+
},
43+
"homepage": "https://github.com/holasoymalva/deepseek-cli#readme",
44+
"engines": {
45+
"node": ">=18.0.0"
46+
},
1647
"dependencies": {
1748
"axios": "^1.6.0",
1849
"chalk": "^4.1.2",

src/.npmignore

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Source files
2+
src/
3+
*.ts
4+
!dist/**/*.d.ts
5+
6+
# Config files
7+
tsconfig.json
8+
.env
9+
.env.example
10+
11+
# Development files
12+
node_modules/
13+
*.log
14+
.git/
15+
.gitignore
16+
17+
# IDE files
18+
.vscode/
19+
.idea/
20+
21+
# Test files
22+
tests/
23+
coverage/
24+
*.test.js
25+
*.spec.js
26+
27+
# Documentation source
28+
docs/
29+
30+
# Other
31+
.DS_Store
32+
*.swp

src/api.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,22 @@ export class DeepSeekAPI {
2727
headers: {
2828
'Authorization': `Bearer ${this.config.apiKey}`,
2929
'Content-Type': 'application/json'
30-
}
30+
},
31+
timeout: 30000 // 30 segundos
3132
}
3233
);
3334

3435
return response.data.choices[0].message.content;
3536
} catch (error: any) {
3637
if (error.response?.status === 401) {
37-
throw new Error('Invalid API key');
38+
throw new Error('Invalid API key. Please check your DEEPSEEK_API_KEY.');
3839
}
3940
if (error.response?.status === 429) {
40-
throw new Error('Rate limit exceeded');
41+
throw new Error('Rate limit exceeded. Please try again later.');
42+
}
43+
if (error.response?.status === 400) {
44+
console.error('API Error Details:', error.response?.data);
45+
throw new Error(`Bad request: ${error.response?.data?.error?.message || 'Invalid request format'}`);
4146
}
4247
throw new Error(`API error: ${error.message}`);
4348
}

src/commands/interactive.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export async function interactiveCommand(config: Config): Promise<void> {
99
const rl = readline.createInterface({
1010
input: process.stdin,
1111
output: process.stdout,
12-
prompt: chalk.green('deepseek> ')
12+
prompt: chalk.green('deepseek-cli > ')
1313
});
1414

1515
rl.on('line', async (input) => {

src/config.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export interface Config {
77
export function getConfig(): Config {
88
return {
99
apiKey: process.env.DEEPSEEK_API_KEY || '',
10-
model: process.env.DEEPSEEK_MODEL || 'deepseek-coder-33b-instruct',
11-
apiUrl: 'https://api.deepseek.com/v1/chat/completions'
10+
model: process.env.DEEPSEEK_MODEL || 'deepseek-chat',
11+
apiUrl: 'https://api.deepseek.com/chat/completions'
1212
};
13-
}
13+
}

0 commit comments

Comments
 (0)