akundigital 0.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 AkunDigital
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.
package/README.md ADDED
@@ -0,0 +1,44 @@
1
+ # akundigital
2
+
3
+ A command-line interface for AkunDigital.
4
+
5
+ ## Usage
6
+
7
+ Run the latest published version without installing it:
8
+
9
+ ```sh
10
+ npx akundigital help
11
+ npx akundigital version
12
+ ```
13
+
14
+ The initial release provides these commands:
15
+
16
+ - `help` — show available commands
17
+ - `version` — show the installed version
18
+
19
+ Unknown commands return a non-zero exit code and display the usage guide. Future commands can be registered in `src/commands.ts`.
20
+
21
+ ## Development
22
+
23
+ ```sh
24
+ npm install
25
+ npm run typecheck
26
+ npm test
27
+ npm run build
28
+ node dist/index.js help
29
+ ```
30
+
31
+ ## Publishing
32
+
33
+ Publishing runs from GitHub Actions when a semantic version tag is pushed. Add a repository secret named `NPM_TOKEN` containing an npm granular access token with package publish access and 2FA bypass enabled, then release with:
34
+
35
+ ```sh
36
+ git tag v0.1.0
37
+ git push origin v0.1.0
38
+ ```
39
+
40
+ Do not put the token in the repository or local `.npmrc`.
41
+
42
+ ## License
43
+
44
+ MIT
@@ -0,0 +1,10 @@
1
+ export type CommandContext = {
2
+ args: string[];
3
+ output: (message: string) => void;
4
+ };
5
+ export type Command = {
6
+ description: string;
7
+ run: (context: CommandContext) => number;
8
+ };
9
+ export declare const createCommands: (version: string) => Record<string, Command>;
10
+ export declare const runCommand: (commandName: string | undefined, args: string[], version: string, output: (message: string) => void, error: (message: string) => void) => number;
@@ -0,0 +1,41 @@
1
+ export const createCommands = (version) => ({
2
+ help: {
3
+ description: "Show available commands",
4
+ run: ({ output }) => {
5
+ output([
6
+ "Usage: akundigital <command> [arguments]",
7
+ "",
8
+ "Commands:",
9
+ " help Show available commands",
10
+ " version Show the installed version",
11
+ "",
12
+ "Run `akundigital <command> --help` for command-specific help.",
13
+ ].join("\n"));
14
+ return 0;
15
+ },
16
+ },
17
+ version: {
18
+ description: "Show the installed version",
19
+ run: ({ output }) => {
20
+ output(version);
21
+ return 0;
22
+ },
23
+ },
24
+ });
25
+ export const runCommand = (commandName, args, version, output, error) => {
26
+ const commands = createCommands(version);
27
+ if (!commandName || commandName === "--help" || commandName === "-h") {
28
+ return commands.help.run({ args, output });
29
+ }
30
+ if (commandName === "--version" || commandName === "-v") {
31
+ return commands.version.run({ args, output });
32
+ }
33
+ const command = commands[commandName];
34
+ if (!command) {
35
+ error(`Unknown command: ${commandName}`);
36
+ commands.help.run({ args: [], output });
37
+ return 1;
38
+ }
39
+ return command.run({ args, output });
40
+ };
41
+ //# sourceMappingURL=commands.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commands.js","sourceRoot":"","sources":["../src/commands.ts"],"names":[],"mappings":"AAUA,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AQ,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;QACxC,OAAO,CAAC,CAAC;IACX,CAAC;IAED,OAAO,OAAO,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;AACvC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
package/dist/index.js ADDED
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire } from "node:module";
3
+ import { runCommand } from "./commands.js";
4
+ const require = createRequire(import.meta.url);
5
+ const packageJson = require("../package.json");
6
+ const exitCode = runCommand(process.argv[2], process.argv.slice(3), packageJson.version, (message) => console.log(message), (message) => console.error(message));
7
+ if (exitCode !== 0) {
8
+ process.exitCode = exitCode;
9
+ }
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC/C,MAAM,WAAW,GAAG,OAAO,CAAC,iBAAiB,CAAwB,CAAC;AAEtE,MAAM,QAAQ,GAAG,UAAU,CACzB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EACf,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EACrB,WAAW,CAAC,OAAO,EACnB,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,EACjC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CACpC,CAAC;AAEF,IAAI,QAAQ,KAAK,CAAC,EAAE,CAAC;IACnB,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAC9B,CAAC"}
package/package.json ADDED
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "akundigital",
3
+ "version": "0.1.0",
4
+ "description": "A command-line interface for AkunDigital.",
5
+ "type": "module",
6
+ "bin": {
7
+ "akundigital": "dist/index.js"
8
+ },
9
+ "files": [
10
+ "dist"
11
+ ],
12
+ "scripts": {
13
+ "build": "tsc",
14
+ "typecheck": "tsc --noEmit",
15
+ "test": "npm run build && node --test",
16
+ "prepublishOnly": "npm run typecheck && npm test"
17
+ },
18
+ "engines": {
19
+ "node": ">=18"
20
+ },
21
+ "repository": {
22
+ "type": "git",
23
+ "url": "https://github.com/akundigital/cli.git"
24
+ },
25
+ "bugs": {
26
+ "url": "https://github.com/akundigital/cli/issues"
27
+ },
28
+ "homepage": "https://github.com/akundigital/cli#readme",
29
+ "license": "MIT",
30
+ "keywords": [
31
+ "akundigital",
32
+ "cli"
33
+ ],
34
+ "devDependencies": {
35
+ "@types/node": "^22.10.2",
36
+ "typescript": "^5.7.2"
37
+ }
38
+ }