Skip to content

Commit

Permalink
Add CLI support
Browse files Browse the repository at this point in the history
  • Loading branch information
223880 committed Sep 13, 2024
1 parent b067fec commit f983b1d
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ Import packages or modules for build your own application
- [ ] Frost
- [ ] Musig2
- [ ] Miniscript
- [ ] CLI
- [x] CLI
- [ ] Breez SDK compatible
- [ ] DLC message

Expand Down
30 changes: 25 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"tiny-secp256k1": "^2.0.0",
"wif": "^5.0.0",
"@nostr-dev-kit/ndk": "^2.10.0",
"@synonymdev/react-native-ldk": "^0.0.152"
"@synonymdev/react-native-ldk": "^0.0.152",
"commander": "^12.1.0"
},
"publishConfig": {
"registry": "https://registry.npmjs.org",
Expand Down
15 changes: 15 additions & 0 deletions src/cli/cli.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env node

const { program } = require('commander');
const { myLibraryFunction } = require('./lib'); // Import your library functions here

program
.version('1.0.0')
.description('A CLI for My Library')
.option('-n, --name <name>', 'Provide a name')
.action((options) => {
console.log('Name:', options.name);
myLibraryFunction(options.name); // Call the library function
});

program.parse(process.argv);

0 comments on commit f983b1d

Please sign in to comment.