amorphous-cli 0.1.1 → 0.1.2

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/lib/help.mjs CHANGED
@@ -33,7 +33,7 @@ export const COMMAND_HELP = {
33
33
  login: `login <email> [--code <code>]
34
34
 
35
35
  Send a sign-in code to that email, then type it.
36
- --code skips the prompt when you already have the code.`,
36
+ --code skips the prompt. An agent reads the code from the inbox and passes it here.`,
37
37
 
38
38
  list: `list [--view recents|all|starred|archive] [--folder <name>] [--tag <name>] [--search <q>] [--json]
39
39
 
package/lib/login.mjs CHANGED
@@ -64,9 +64,11 @@ async function loginViaMailpit(supabase, email, redirectTo, sinceMs) {
64
64
  }
65
65
  }
66
66
 
67
- async function readCode() {
67
+ async function readCode(email) {
68
68
  if (!process.stdin.isTTY) {
69
- throw new Error('Pass the code with --code.')
69
+ throw new Error(
70
+ `Code sent to ${email}. Read it from that inbox, then run: amorphous login ${email} --code <code>`,
71
+ )
70
72
  }
71
73
  const rl = createInterface({ input: process.stdin, output: process.stderr })
72
74
  try {
@@ -125,7 +127,7 @@ export async function loginWithMagicLink(email, { code } = {}) {
125
127
  const { error } = await supabase.auth.signInWithOtp({ email })
126
128
  if (error) throw error
127
129
  console.error(`Code sent to ${email}.`)
128
- code = await readCode()
130
+ code = await readCode(email)
129
131
  }
130
132
 
131
133
  finish(await verifyEmailCode(supabase, email, code))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "amorphous-cli",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Command line for Amorphous",
5
5
  "type": "module",
6
6
  "bin": {