autoclaw 1.0.1 → 1.0.3

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.
Files changed (3) hide show
  1. package/README.md +19 -5
  2. package/dist/index.js +13 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -16,6 +16,14 @@ AutoClaw is a lightweight AI agent CLI tool that brings the power of Large Langu
16
16
  npm install -g autoclaw
17
17
  ```
18
18
 
19
+ ## Updating
20
+
21
+ To update AutoClaw to the latest version:
22
+
23
+ ```bash
24
+ npm update -g autoclaw
25
+ ```
26
+
19
27
  ## Quick Start
20
28
 
21
29
  1. **Setup**: Run the setup wizard to configure your API key.
@@ -35,12 +43,18 @@ npm install -g autoclaw
35
43
 
36
44
  ## Configuration
37
45
 
38
- AutoClaw uses a `.env` file in the current working directory or creates one globally during setup.
46
+ AutoClaw uses a global JSON configuration file located at `~/.autoclaw/setting.json`.
47
+ You can also use a local `.env` file in your current directory to override global settings.
48
+
49
+ Priority order:
50
+ 1. Command-line arguments (e.g., `-m`)
51
+ 2. Local `.env` file
52
+ 3. Global config (`~/.autoclaw/setting.json`)
39
53
 
40
- Supported Environment Variables:
41
- - `OPENAI_API_KEY`: Your API Key.
42
- - `OPENAI_BASE_URL`: Custom Base URL (e.g., for LocalLLM or other providers).
43
- - `OPENAI_MODEL`: Default model to use (default: `gpt-4o`).
54
+ Supported Configuration Keys:
55
+ - `apiKey`: Your API Key.
56
+ - `baseUrl`: Custom Base URL.
57
+ - `model`: Default model to use (default: `gpt-4o`).
44
58
 
45
59
  ## License
46
60
 
package/dist/index.js CHANGED
@@ -7,6 +7,7 @@ import { Agent } from './agent.js';
7
7
  import * as fs from 'fs';
8
8
  import * as path from 'path';
9
9
  import * as os from 'os';
10
+ import { fileURLToPath } from 'url';
10
11
  const CONFIG_DIR = path.join(os.homedir(), '.autoclaw');
11
12
  const CONFIG_FILE = path.join(CONFIG_DIR, 'setting.json');
12
13
  function loadGlobalConfig() {
@@ -22,11 +23,22 @@ function loadGlobalConfig() {
22
23
  }
23
24
  // Load local env vars
24
25
  dotenv.config();
26
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
27
+ // In dist/index.js, package.json is usually up one level in the root
28
+ const pkgPath = path.join(__dirname, '..', 'package.json');
29
+ let version = '1.0.2';
30
+ try {
31
+ const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'));
32
+ version = pkg.version;
33
+ }
34
+ catch (e) {
35
+ // Fallback if package.json not found in expected location
36
+ }
25
37
  const program = new Command();
26
38
  program
27
39
  .name('autoclaw')
28
40
  .description('A lightweight AI agent CLI tool')
29
- .version('1.0.1');
41
+ .version(version);
30
42
  program
31
43
  .command('setup')
32
44
  .description('Run the interactive setup wizard to configure API keys')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "autoclaw",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "bin": {