freeai-code 0.1.4 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -5
- package/bin/free-code +3 -2
- package/install.js +8 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,20 +6,23 @@ Powered by [Free.ai](https://free.ai).
|
|
|
6
6
|
|
|
7
7
|
## Install
|
|
8
8
|
|
|
9
|
+
The one-liner needs no Python or Node setup:
|
|
10
|
+
|
|
9
11
|
```bash
|
|
10
|
-
|
|
12
|
+
curl -fsSL https://free.ai/install.sh | sh # macOS / Linux
|
|
13
|
+
irm https://free.ai/install.ps1 | iex # Windows PowerShell
|
|
11
14
|
```
|
|
12
15
|
|
|
13
|
-
Or with
|
|
16
|
+
Or with npm (needs Python 3.9+):
|
|
14
17
|
|
|
15
18
|
```bash
|
|
16
|
-
|
|
19
|
+
npm install -g freeai-code
|
|
17
20
|
```
|
|
18
21
|
|
|
19
|
-
Or
|
|
22
|
+
Or with pip:
|
|
20
23
|
|
|
21
24
|
```bash
|
|
22
|
-
|
|
25
|
+
pip install freeai-code
|
|
23
26
|
```
|
|
24
27
|
|
|
25
28
|
## Quick Start
|
package/bin/free-code
CHANGED
|
@@ -40,16 +40,17 @@ find_free_code() {
|
|
|
40
40
|
return 1
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
+
export FREE_CODE_INSTALLED_VIA=npm
|
|
43
44
|
FREE_CODE_BIN=$(find_free_code) || true
|
|
44
45
|
|
|
45
46
|
if [ -z "$FREE_CODE_BIN" ]; then
|
|
46
47
|
echo "free-code: Python package not found." >&2
|
|
47
48
|
echo "" >&2
|
|
48
49
|
echo "Install it with:" >&2
|
|
49
|
-
echo " pip install
|
|
50
|
+
echo " pip install freeai-code" >&2
|
|
50
51
|
echo "" >&2
|
|
51
52
|
echo "Or reinstall the npm package:" >&2
|
|
52
|
-
echo " npm install -g
|
|
53
|
+
echo " npm install -g freeai-code" >&2
|
|
53
54
|
exit 1
|
|
54
55
|
fi
|
|
55
56
|
|
package/install.js
CHANGED
|
@@ -90,7 +90,7 @@ function main() {
|
|
|
90
90
|
error("Python 3.9+ is required but not found.");
|
|
91
91
|
error("Install Python from https://python.org or https://free.ai/install");
|
|
92
92
|
console.error("");
|
|
93
|
-
error("After installing Python, run: pip install
|
|
93
|
+
error("After installing Python, run: pip install freeai-code");
|
|
94
94
|
process.exit(0); // Don't fail npm install, the bin script will show the error
|
|
95
95
|
}
|
|
96
96
|
|
|
@@ -104,14 +104,14 @@ function main() {
|
|
|
104
104
|
if (bootstrap === null) {
|
|
105
105
|
error("Could not find or install pip.");
|
|
106
106
|
error("Install pip manually: https://pip.pypa.io/en/stable/installation/");
|
|
107
|
-
error("Then run: pip install
|
|
107
|
+
error("Then run: pip install freeai-code");
|
|
108
108
|
process.exit(0);
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
111
|
|
|
112
112
|
const pipInfo = pip || findPip(python.cmd);
|
|
113
113
|
if (!pipInfo) {
|
|
114
|
-
error("pip setup failed. Install manually: pip install
|
|
114
|
+
error("pip setup failed. Install manually: pip install freeai-code");
|
|
115
115
|
process.exit(0);
|
|
116
116
|
}
|
|
117
117
|
|
|
@@ -119,9 +119,9 @@ function main() {
|
|
|
119
119
|
|
|
120
120
|
let installCmd;
|
|
121
121
|
if (pipInfo.type === "pipx") {
|
|
122
|
-
installCmd = "pipx install
|
|
122
|
+
installCmd = "pipx install freeai-code";
|
|
123
123
|
} else {
|
|
124
|
-
installCmd = `${pipInfo.cmd} install
|
|
124
|
+
installCmd = `${pipInfo.cmd} install freeai-code`;
|
|
125
125
|
}
|
|
126
126
|
|
|
127
127
|
const result = spawnSync(installCmd, {
|
|
@@ -134,17 +134,17 @@ function main() {
|
|
|
134
134
|
// Try with --user flag if regular install fails
|
|
135
135
|
if (pipInfo.type === "pip") {
|
|
136
136
|
log("Retrying with --user flag...");
|
|
137
|
-
const retry = spawnSync(`${pipInfo.cmd} install --user
|
|
137
|
+
const retry = spawnSync(`${pipInfo.cmd} install --user freeai-code`, {
|
|
138
138
|
shell: true,
|
|
139
139
|
stdio: "inherit",
|
|
140
140
|
});
|
|
141
141
|
if (retry.status !== 0) {
|
|
142
142
|
warn("pip install failed. You may need to run manually:");
|
|
143
|
-
warn(` ${pipInfo.cmd} install
|
|
143
|
+
warn(` ${pipInfo.cmd} install freeai-code`);
|
|
144
144
|
process.exit(0);
|
|
145
145
|
}
|
|
146
146
|
} else {
|
|
147
|
-
warn("Installation failed. Run manually: pip install
|
|
147
|
+
warn("Installation failed. Run manually: pip install freeai-code");
|
|
148
148
|
process.exit(0);
|
|
149
149
|
}
|
|
150
150
|
}
|