Skip to content

Commit 8bb616c

Browse files
committed
Initial commit
0 parents  commit 8bb616c

File tree

7 files changed

+461
-0
lines changed

7 files changed

+461
-0
lines changed

.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
.vscode
2+
.idea
3+
.next
4+
.docusaurus
5+
.cache
6+
release-builds
7+
node_modules
8+
build
9+
temp
10+
__pycache__
11+
12+
.env
13+
.vercel
14+
test.js
15+
16+
**/.DS_Store
17+
.DS_Store?
18+
Thumbs.db
19+
desktop.ini
20+
21+
package-lock.json
22+
pnpm-lock.yaml
23+
yarn.lock
24+
bun.lockb

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Johan
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.fr.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
###### English version [here](https://github.com/johan-perso/magic-command/blob/main/README.md).
2+
3+
# Magic Command
4+
5+
Obtenez une commande générée par IA en un instant depuis votre terminal. Utilisez n'importe quel modèle disponible sur [OpenRouter](https://openrouter.ai), **vous aurez besoin de votre propre clé d'API**.
6+
7+
8+
## Installation
9+
10+
> Magic Command ne supporte que les versions récentes de NodeJS (v20+).
11+
12+
```bash
13+
# Avec npm
14+
npm i -g magic-command
15+
16+
# Ou avec pnpm
17+
pnpm i -g magic-command
18+
```
19+
20+
```bash
21+
$ magiccommand --version
22+
$ magiccommand --help
23+
```
24+
25+
```bash
26+
$ magiccommand "Initialise une app Vite"
27+
28+
# ╭ Magic Command ────────────────────────╮
29+
# │ │
30+
# │ npm init vite@latest │
31+
# │ │
32+
# │ Usage: 417 tokens, took 1.10 secs │
33+
# │ │
34+
# ╰───────────────────────────────────────╯
35+
```
36+
37+
38+
## Configuration
39+
40+
Vous aurez besoin d'ajouter votre clé d'API [OpenRouter](https://openrouter.ai) dans vos variables d'environnement, cela se fait généralement via le fichier `.bashrc` ou `.zshrc` sur macOS et Linux.
41+
42+
```env
43+
# Authentification, requise
44+
MAGICCOMMAND_OPENROUTER_KEY=sk-or-...
45+
46+
# Personnalisation, facultatif
47+
MAGICCOMMAND_OPENROUTER_MODEL=openai/gpt-4o-mini
48+
```
49+
50+
51+
## Licence
52+
53+
MIT © [Johan](https://johanstick.fr). Soutenez ce projet via [Ko-Fi](https://ko-fi.com/johan_stickman) ou [PayPal](https://paypal.me/moipastoii) si vous souhaitez m'aider 💙

README.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
###### Version française [ici](https://github.com/johan-perso/magic-command/blob/main/README.fr.md).
2+
3+
# Magic Command
4+
5+
Get an AI-generated command instantly from your terminal. Use any model available on [OpenRouter](https://openrouter.ai), **you'll need your own API key**.
6+
7+
8+
## Installation
9+
10+
> TeableToJSON only supports recent versions of NodeJS (v20+).
11+
12+
```bash
13+
# With npm
14+
npm i -g magic-command
15+
16+
# Or with pnpm
17+
pnpm i -g magic-command
18+
```
19+
20+
```bash
21+
$ magiccommand --version
22+
$ magiccommand --help
23+
```
24+
25+
```bash
26+
$ magiccommand "Init Vite App"
27+
28+
# ╭ Magic Command ────────────────────────╮
29+
# │ │
30+
# │ npm init vite@latest │
31+
# │ │
32+
# │ Usage: 417 tokens, took 1.10 secs │
33+
# │ │
34+
# ╰───────────────────────────────────────╯
35+
```
36+
37+
38+
## Configuration
39+
40+
You will need to add your [OpenRouter](https://openrouter.ai) API key to your environment variables, this is usually done through the `.bashrc` or `.zshrc` file on macOS and Linux.
41+
42+
```env
43+
# Authentication, required
44+
MAGICCOMMAND_OPENROUTER_KEY=sk-or-...
45+
46+
# Customization, optional
47+
MAGICCOMMAND_OPENROUTER_MODEL=openai/gpt-4o-mini
48+
```
49+
50+
51+
## Licence
52+
53+
MIT © [Johan](https://johanstick.fr). Support this project via [Ko-Fi](https://ko-fi.com/johan_stickman) or [PayPal](https://paypal.me/moipastoii) if you want to help me 💙

eslint.config.js

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
module.exports = [
2+
{
3+
ignores: ["node_modules/"],
4+
},
5+
{
6+
languageOptions: {
7+
ecmaVersion: "latest",
8+
sourceType: "module",
9+
},
10+
linterOptions: {
11+
reportUnusedDisableDirectives: true,
12+
},
13+
rules: {
14+
"indent": ["warn", "tab"],
15+
"quotes": ["warn", "double"],
16+
"semi": ["warn", "never"],
17+
"implicit-arrow-linebreak": ["warn", "beside"],
18+
"dot-notation": "warn",
19+
"no-unused-vars": ["warn", { "args": "none", "caughtErrors": "none" }],
20+
"no-unneeded-ternary": "warn",
21+
"no-mixed-operators": "warn",
22+
"nonblock-statement-body-position": ["warn", "beside"],
23+
"spaced-comment": ["warn", "always"],
24+
"no-multi-spaces": "warn",
25+
"space-infix-ops": "warn",
26+
"comma-spacing": "warn",
27+
"key-spacing": "warn",
28+
"space-in-parens": "warn",
29+
"array-bracket-spacing": "warn",
30+
"object-curly-spacing": ["warn", "always"],
31+
"no-trailing-spaces": "warn",
32+
"comma-style": "warn",
33+
"no-array-constructor": "warn",
34+
"prefer-template": "warn",
35+
"template-curly-spacing": "warn",
36+
"no-new-object": "warn",
37+
"no-useless-concat": "warn",
38+
"no-useless-return": "warn",
39+
"no-useless-escape": "warn",
40+
"no-useless-constructor": "warn",
41+
"default-param-last": "warn",
42+
"no-new-func": "warn",
43+
"no-dupe-class-members": "warn",
44+
"no-duplicate-imports": "warn",
45+
"function-paren-newline": ["warn", "multiline"],
46+
"prefer-arrow-callback": "warn",
47+
"arrow-spacing": "warn",
48+
"no-empty": ["warn", { "allowEmptyCatch": true }],
49+
"no-multiple-empty-lines": ["warn", { "max": 1 }],
50+
"no-redeclare": "off",
51+
"no-control-regex": "off",
52+
},
53+
},
54+
]

0 commit comments

Comments
 (0)