moralis-cli 0.1.0 → 0.1.1

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 +8 -2
  2. package/package.json +1 -1
  3. package/src/cli.js +19 -0
package/README.md CHANGED
@@ -11,7 +11,7 @@ Follow these steps to start using Moralis CLI with your AI agent.
11
11
  Install:
12
12
 
13
13
  ```bash
14
- npx -g moralis-cli
14
+ npm install -g moralis-cli
15
15
  ```
16
16
 
17
17
  Login:
@@ -22,6 +22,12 @@ moralis-cli login
22
22
 
23
23
  Enter your Moralis API key when prompted (stored securely).
24
24
 
25
+ Check login status:
26
+
27
+ ```bash
28
+ moralis-cli status
29
+ ```
30
+
25
31
  Connect to AI
26
32
 
27
33
  Import the [@moralis-cli](.codex/skills/moralis-cli/SKILL.md) skill into your AI agent and start making Moralis API calls securely.
@@ -51,4 +57,4 @@ Codex:
51
57
 
52
58
  # License
53
59
 
54
- MIT
60
+ MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "moralis-cli",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Use Moralis API via Moralis CLI directly inside AI agents with secure API key handling and access to EVM and Solana blockchain data.",
5
5
  "bin": {
6
6
  "moralis-cli": "bin/moralis-cli.js"
package/src/cli.js CHANGED
@@ -42,6 +42,11 @@ async function main() {
42
42
  return;
43
43
  }
44
44
 
45
+ if (command === 'status') {
46
+ await showLoginStatus();
47
+ return;
48
+ }
49
+
45
50
  const apiTarget = getApiTarget(command);
46
51
  if (apiTarget) {
47
52
  await handleApiCommand(apiTarget, args.slice(1));
@@ -138,12 +143,14 @@ async function printGlobalHelp(args = []) {
138
143
  console.log(' moralis-cli help <evm|solana>');
139
144
  console.log(' moralis-cli login <api_key>');
140
145
  console.log(' moralis-cli login');
146
+ console.log(' moralis-cli status');
141
147
  console.log(' moralis-cli evm <operationId> [required-path-args...] [--optional value]');
142
148
  console.log(' moralis-cli solana <operationId> [required-path-args...] [--optional value]');
143
149
  console.log('');
144
150
  console.log('Built-in commands:');
145
151
  console.log(' help - Show this help message');
146
152
  console.log(' login - Save Moralis API key (prompts if omitted)');
153
+ console.log(' status - Show whether a Moralis API key is saved');
147
154
  console.log(' evm - Run EVM API operations');
148
155
  console.log(' solana - Run Solana API operations');
149
156
  console.log('');
@@ -214,6 +221,18 @@ async function login(args) {
214
221
  console.log('API key saved.');
215
222
  }
216
223
 
224
+ async function showLoginStatus() {
225
+ const config = await readConfig();
226
+ const hasApiKey = typeof config.apiKey === 'string' && config.apiKey.trim().length > 0;
227
+
228
+ if (hasApiKey) {
229
+ console.log('Logged in: yes');
230
+ return;
231
+ }
232
+
233
+ console.log('Logged in: no');
234
+ }
235
+
217
236
  function promptHidden(promptText) {
218
237
  return new Promise((resolve, reject) => {
219
238
  const stdin = process.stdin;