create-lousho 0.0.0-stage → 0.1.2-alpha.12

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 CHANGED
@@ -1,3 +1,45 @@
1
- # Temporary Holding Version
1
+ # create-lousho
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Scaffold a new [`lousho`](https://www.npmjs.com/package/lousho) project with one command:
4
+
5
+ ```bash
6
+ npm create lousho my-agent
7
+ cd my-agent
8
+ # copy .env.example to .env (cp on macOS/Linux, copy on Windows), then put your API key in it
9
+ npm run dev # chat with your agent in the terminal
10
+ npm test # offline tests: no API key needed
11
+ ```
12
+
13
+ You get an agent with an example tool, an offline test that uses a mock model, a `.env.example` for your provider, a strict `tsconfig.json` and a README. Dependencies are installed and `git init` is run for you. Requires Node.js 22.19 or newer.
14
+
15
+ ## Options
16
+
17
+ Without arguments it asks for the directory, the provider and the template. For scripts, pass `--yes` and any of:
18
+
19
+ | Option | Values |
20
+ | ------ | ------ |
21
+ | `--provider` | `openai`, `anthropic`, `openrouter`, `ollama`, `pi` |
22
+ | `--template` | `minimal`, `tools`, `yaml` |
23
+ | `--package-manager` | `npm`, `pnpm`, `yarn`, `bun` |
24
+ | `--no-install` | skip installing dependencies |
25
+ | `--no-git` | skip `git init` |
26
+ | `--force` | write into a non-empty directory |
27
+ | `--sdk-path <dir\|tgz>` | for SDK development: depend on an SDK checkout or a packed `.tgz` instead of the published version |
28
+
29
+ With npm, put the options after `--`:
30
+
31
+ ```bash
32
+ npm create lousho my-agent -- --yes --provider anthropic --template tools
33
+ ```
34
+
35
+ Running a packed `.tgz` of this package on Windows: `npx C:\abs\path\create-lousho-<version>.tgz` silently does nothing (an npm quirk with absolute drive-letter paths). Use a relative path (`npx ./create-lousho-<version>.tgz my-agent`) or a `file:` spec (`npx file:C:/abs/path/create-lousho-<version>.tgz my-agent`).
36
+
37
+ This package is a thin wrapper: it runs `lousho init` from the SDK, so `npx lousho init --help` lists every option.
38
+
39
+ ## Links
40
+
41
+ - Documentation: [lousho.com](https://lousho.com) (English and Arabic)
42
+ - Quick start: [lousho.com/quickstart](https://lousho.com/quickstart)
43
+ - Source: [github.com/LinuxDevil/agent-sdk](https://github.com/LinuxDevil/agent-sdk)
44
+
45
+ MIT licensed.
package/bin/cli.js ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+
4
+ const { main } = require('../dist/index.js');
5
+
6
+ main(process.argv.slice(2)).then(
7
+ (code) => {
8
+ process.exitCode = typeof code === 'number' ? code : 0;
9
+ },
10
+ (err) => {
11
+ console.error(err && err.stack ? err.stack : String(err));
12
+ process.exitCode = 1;
13
+ }
14
+ );
@@ -0,0 +1,13 @@
1
+ /**
2
+ * `npm create lousho [dir] [options]` is `lousho init [dir] [options]`.
3
+ *
4
+ * The generator lives in the SDK (`src/cli/init.ts`) so there is exactly one
5
+ * copy of it; this package only depends on the SDK (same version line) and
6
+ * runs its `lousho` binary. `lousho init --help` lists the options.
7
+ */
8
+ /** Absolute path of the `lousho` bin of the installed `lousho`. */
9
+ declare function loushoBin(): string;
10
+ /** Runs `lousho init <argv>`; resolves to its exit code. */
11
+ declare function main(argv: string[]): Promise<number>;
12
+
13
+ export { loushoBin, main };
package/dist/index.js ADDED
@@ -0,0 +1,38 @@
1
+ 'use strict';
2
+
3
+ var child_process = require('child_process');
4
+ var path = require('path');
5
+
6
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
7
+
8
+ var path__default = /*#__PURE__*/_interopDefault(path);
9
+
10
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
11
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
12
+ }) : x)(function(x) {
13
+ if (typeof require !== "undefined") return require.apply(this, arguments);
14
+ throw Error('Dynamic require of "' + x + '" is not supported');
15
+ });
16
+ function loushoBin() {
17
+ const entry = __require.resolve("lousho");
18
+ return path__default.default.join(path__default.default.dirname(entry), "..", "bin", "lousho.js");
19
+ }
20
+ function main(argv) {
21
+ if (argv.includes("--help") || argv.includes("-h")) {
22
+ process.stdout.write("npm create lousho [dir] -- [options] runs `lousho init [dir] [options]`:\n\n");
23
+ }
24
+ return new Promise((resolve) => {
25
+ const child = child_process.spawn(process.execPath, [loushoBin(), "init", ...argv], { stdio: "inherit" });
26
+ child.on("error", (error) => {
27
+ process.stderr.write(`create-lousho: could not run lousho init: ${error.message}
28
+ `);
29
+ resolve(1);
30
+ });
31
+ child.on("close", (code) => resolve(code ?? 1));
32
+ });
33
+ }
34
+
35
+ exports.loushoBin = loushoBin;
36
+ exports.main = main;
37
+ //# sourceMappingURL=index.js.map
38
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"names":["path","spawn"],"mappings":";;;;;;;;;;;;;;;AAYO,SAAS,SAAA,GAAoB;AAGlC,EAAA,MAAM,KAAA,GAAQ,SAAA,CAAQ,OAAA,CAAQ,QAAQ,CAAA;AACtC,EAAA,OAAOA,qBAAA,CAAK,KAAKA,qBAAA,CAAK,OAAA,CAAQ,KAAK,CAAA,EAAG,IAAA,EAAM,OAAO,WAAW,CAAA;AAChE;AAGO,SAAS,KAAK,IAAA,EAAiC;AACpD,EAAA,IAAI,KAAK,QAAA,CAAS,QAAQ,KAAK,IAAA,CAAK,QAAA,CAAS,IAAI,CAAA,EAAG;AAElD,IAAA,OAAA,CAAQ,MAAA,CAAO,MAAM,8EAA8E,CAAA;AAAA,EACrG;AACA,EAAA,OAAO,IAAI,OAAA,CAAQ,CAAC,OAAA,KAAY;AAC9B,IAAA,MAAM,KAAA,GAAQC,mBAAA,CAAM,OAAA,CAAQ,QAAA,EAAU,CAAC,SAAA,EAAU,EAAG,MAAA,EAAQ,GAAG,IAAI,CAAA,EAAG,EAAE,KAAA,EAAO,WAAW,CAAA;AAC1F,IAAA,KAAA,CAAM,EAAA,CAAG,OAAA,EAAS,CAAC,KAAA,KAAU;AAC3B,MAAA,OAAA,CAAQ,MAAA,CAAO,KAAA,CAAM,CAAA,0CAAA,EAA6C,KAAA,CAAM,OAAO;AAAA,CAAI,CAAA;AACnF,MAAA,OAAA,CAAQ,CAAC,CAAA;AAAA,IACX,CAAC,CAAA;AACD,IAAA,KAAA,CAAM,GAAG,OAAA,EAAS,CAAC,SAAS,OAAA,CAAQ,IAAA,IAAQ,CAAC,CAAC,CAAA;AAAA,EAChD,CAAC,CAAA;AACH","file":"index.js","sourcesContent":["import { spawn } from 'node:child_process';\nimport path from 'node:path';\n\n/**\n * `npm create lousho [dir] [options]` is `lousho init [dir] [options]`.\n *\n * The generator lives in the SDK (`src/cli/init.ts`) so there is exactly one\n * copy of it; this package only depends on the SDK (same version line) and\n * runs its `lousho` binary. `lousho init --help` lists the options.\n */\n\n/** Absolute path of the `lousho` bin of the installed `lousho`. */\nexport function loushoBin(): string {\n // The package's \"exports\" map hides package.json, but the \".\" entry\n // (<root>/dist/index.js) is resolvable and bin/ is its sibling of dist/.\n const entry = require.resolve('lousho');\n return path.join(path.dirname(entry), '..', 'bin', 'lousho.js');\n}\n\n/** Runs `lousho init <argv>`; resolves to its exit code. */\nexport function main(argv: string[]): Promise<number> {\n if (argv.includes('--help') || argv.includes('-h')) {\n // The usage below is `lousho init`'s; say how it maps to this command.\n process.stdout.write('npm create lousho [dir] -- [options] runs `lousho init [dir] [options]`:\\n\\n');\n }\n return new Promise((resolve) => {\n const child = spawn(process.execPath, [loushoBin(), 'init', ...argv], { stdio: 'inherit' });\n child.on('error', (error) => {\n process.stderr.write(`create-lousho: could not run lousho init: ${error.message}\\n`);\n resolve(1);\n });\n child.on('close', (code) => resolve(code ?? 1));\n });\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,45 @@
1
1
  {
2
2
  "name": "create-lousho",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.2-alpha.12",
4
+ "description": "npm create lousho: scaffold a new lousho project (runs `lousho init`)",
5
+ "license": "MIT",
6
+ "homepage": "https://lousho.com",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/LinuxDevil/agent-sdk.git",
10
+ "directory": "packages/create-lousho"
11
+ },
12
+ "keywords": [
13
+ "lousho",
14
+ "ai",
15
+ "agents",
16
+ "create",
17
+ "scaffold"
18
+ ],
19
+ "type": "commonjs",
20
+ "engines": {
21
+ "node": ">=22.19.0"
22
+ },
23
+ "bin": {
24
+ "create-lousho": "bin/cli.js"
25
+ },
26
+ "files": [
27
+ "dist",
28
+ "bin"
29
+ ],
30
+ "scripts": {
31
+ "build": "tsup",
32
+ "test": "vitest run",
33
+ "typecheck": "tsc --noEmit"
34
+ },
35
+ "dependencies": {
36
+ "lousho": "^1.0.0-alpha.33",
37
+ "prompts": "^2.4.2"
38
+ },
39
+ "devDependencies": {
40
+ "@types/node": "^20.0.0",
41
+ "tsup": "^8.0.0",
42
+ "typescript": "^5.0.0",
43
+ "vitest": "^1.6.1"
44
+ }
45
+ }