|
1 | | -# fbadmin |
| 1 | +# fire-auth |
2 | 2 |
|
3 | 3 | A command-line tool for managing Firebase Authentication — users, custom claims, auth action links, and emulator utilities. |
4 | 4 |
|
@@ -34,121 +34,121 @@ cargo install --path . |
34 | 34 |
|
35 | 35 | ```bash |
36 | 36 | # Interactive setup — creates a named profile |
37 | | -fbadmin config init |
| 37 | +fire-auth config init |
38 | 38 |
|
39 | 39 | # Or connect directly with flags / env vars |
40 | | -fbadmin --credentials ~/sa-key.json users list |
41 | | -fbadmin -e localhost:9099 emulator clear-users |
42 | | -export FBADMIN_PROJECT=my-project |
43 | | -fbadmin users count |
| 40 | +fire-auth --credentials ~/sa-key.json users list |
| 41 | +fire-auth -e localhost:9099 emulator clear-users |
| 42 | +export FIRE_AUTH_PROJECT=my-project |
| 43 | +fire-auth users count |
44 | 44 | ``` |
45 | 45 |
|
46 | 46 | ## Authentication |
47 | 47 |
|
48 | | -fbadmin resolves credentials in this order: |
| 48 | +fire-auth resolves credentials in this order: |
49 | 49 |
|
50 | | -1. `--credentials` / `FBADMIN_CREDENTIALS` — path to a service account JSON file |
51 | | -2. `--project` / `FBADMIN_PROJECT` — project ID using Application Default Credentials |
52 | | -3. `--emulator-host` / `FBADMIN_EMULATOR_HOST` — connect to the Firebase Auth emulator |
| 50 | +1. `--credentials` / `FIRE_AUTH_CREDENTIALS` — path to a service account JSON file |
| 51 | +2. `--project` / `FIRE_AUTH_PROJECT` — project ID using Application Default Credentials |
| 52 | +3. `--emulator-host` / `FIRE_AUTH_EMULATOR_HOST` — connect to the Firebase Auth emulator |
53 | 53 | 4. Profile settings from config (see below) |
54 | 54 |
|
55 | 55 | ## Configuration |
56 | 56 |
|
57 | 57 | Profiles store connection settings so you don't need to pass flags every time. |
58 | 58 |
|
59 | 59 | ```bash |
60 | | -fbadmin config init # Guided wizard |
61 | | -fbadmin config add prod --credentials ~/keys/prod-sa.json |
62 | | -fbadmin config add local --emulator-host localhost:9099 |
63 | | -fbadmin config default prod # Set the default profile |
64 | | -fbadmin config list # Show all profiles |
65 | | -fbadmin config which # Show resolved connection chain |
66 | | -fbadmin config path # Print config file locations |
| 60 | +fire-auth config init # Guided wizard |
| 61 | +fire-auth config add prod --credentials ~/keys/prod-sa.json |
| 62 | +fire-auth config add local --emulator-host localhost:9099 |
| 63 | +fire-auth config default prod # Set the default profile |
| 64 | +fire-auth config list # Show all profiles |
| 65 | +fire-auth config which # Show resolved connection chain |
| 66 | +fire-auth config path # Print config file locations |
67 | 67 | ``` |
68 | 68 |
|
69 | | -Global config is stored by `confy` in the OS-appropriate location. A local `.fbadmin.toml` in the working directory is merged on top (field-level override). |
| 69 | +Global config is stored by `confy` in the OS-appropriate location. A local `.fire-auth.toml` in the working directory is merged on top (field-level override). |
70 | 70 |
|
71 | 71 | ## Commands |
72 | 72 |
|
73 | 73 | ### Users |
74 | 74 |
|
75 | 75 | ```bash |
76 | | -fbadmin users get --email user@example.com |
77 | | -fbadmin users get --uid abc123 |
78 | | -fbadmin users create --email new@example.com |
79 | | -fbadmin users create --email new@example.com --password s3cret --display-name "Jane Doe" |
80 | | -fbadmin users disable --email user@example.com |
81 | | -fbadmin users enable --email user@example.com |
82 | | -fbadmin users remove --csv uids.csv # Bulk delete from CSV |
83 | | -fbadmin users list --limit 50 |
84 | | -fbadmin users list-inactive --days 90 |
85 | | -fbadmin users count |
| 76 | +fire-auth users get --email user@example.com |
| 77 | +fire-auth users get --uid abc123 |
| 78 | +fire-auth users create --email new@example.com |
| 79 | +fire-auth users create --email new@example.com --password s3cret --display-name "Jane Doe" |
| 80 | +fire-auth users disable --email user@example.com |
| 81 | +fire-auth users enable --email user@example.com |
| 82 | +fire-auth users remove --csv uids.csv # Bulk delete from CSV |
| 83 | +fire-auth users list --limit 50 |
| 84 | +fire-auth users list-inactive --days 90 |
| 85 | +fire-auth users count |
86 | 86 | ``` |
87 | 87 |
|
88 | 88 | Missing required arguments are prompted interactively when running in a terminal. Passwords are auto-generated if omitted. |
89 | 89 |
|
90 | 90 | ### Custom claims |
91 | 91 |
|
92 | 92 | ```bash |
93 | | -fbadmin claims get --email user@example.com |
94 | | -fbadmin claims merge role admin --email user@example.com |
95 | | -fbadmin claims merge tier 2 --email user@example.com # Auto-detects int |
96 | | -fbadmin claims merge prefs '{"dark":true}' --email user@example.com # JSON |
97 | | -fbadmin claims remove role --email user@example.com |
98 | | -fbadmin claims clear --email user@example.com |
99 | | -fbadmin claims find admin # Find all users with "admin" claim |
100 | | -fbadmin claims find role admin --exclusive # Only where role is the sole claim |
| 93 | +fire-auth claims get --email user@example.com |
| 94 | +fire-auth claims merge role admin --email user@example.com |
| 95 | +fire-auth claims merge tier 2 --email user@example.com # Auto-detects int |
| 96 | +fire-auth claims merge prefs '{"dark":true}' --email user@example.com # JSON |
| 97 | +fire-auth claims remove role --email user@example.com |
| 98 | +fire-auth claims clear --email user@example.com |
| 99 | +fire-auth claims find admin # Find all users with "admin" claim |
| 100 | +fire-auth claims find role admin --exclusive # Only where role is the sole claim |
101 | 101 | ``` |
102 | 102 |
|
103 | 103 | Use `--dry-run` with `merge`, `remove`, and `clear` to preview changes without writing. |
104 | 104 |
|
105 | 105 | ### Auth action links |
106 | 106 |
|
107 | 107 | ```bash |
108 | | -fbadmin links password-reset --email user@example.com |
109 | | -fbadmin links email-verify --email user@example.com |
110 | | -fbadmin links sign-in --email user@example.com |
| 108 | +fire-auth links password-reset --email user@example.com |
| 109 | +fire-auth links email-verify --email user@example.com |
| 110 | +fire-auth links sign-in --email user@example.com |
111 | 111 | ``` |
112 | 112 |
|
113 | 113 | ### Emulator |
114 | 114 |
|
115 | 115 | These commands only work when connected to an emulator. |
116 | 116 |
|
117 | 117 | ```bash |
118 | | -fbadmin -e localhost:9099 emulator clear-users |
119 | | -fbadmin -e localhost:9099 emulator config |
| 118 | +fire-auth -e localhost:9099 emulator clear-users |
| 119 | +fire-auth -e localhost:9099 emulator config |
120 | 120 | ``` |
121 | 121 |
|
122 | 122 | ### Connection info |
123 | 123 |
|
124 | 124 | ```bash |
125 | | -fbadmin info # Shows resolved profile, project, credentials, and verifies connectivity |
| 125 | +fire-auth info # Shows resolved profile, project, credentials, and verifies connectivity |
126 | 126 | ``` |
127 | 127 |
|
128 | 128 | ## Global flags |
129 | 129 |
|
130 | 130 |
|
131 | | -| Flag | Short | Env var | Description | |
132 | | -| ----------------- | ----- | ----------------------- | ------------------------------------- | |
133 | | -| `--profile` | `-p` | `FBADMIN_PROFILE` | Named profile from config | |
134 | | -| `--project` | | `FBADMIN_PROJECT` | Firebase project ID | |
135 | | -| `--credentials` | `-c` | `FBADMIN_CREDENTIALS` | Path to service account JSON | |
136 | | -| `--emulator-host` | `-e` | `FBADMIN_EMULATOR_HOST` | Emulator host:port | |
137 | | -| `--format` | `-f` | | Output format: `table`, `json`, `csv` | |
138 | | -| `--dry-run` | | | Preview destructive operations | |
139 | | -| `--yes` | `-y` | | Skip confirmation prompts | |
140 | | -| `--verbose` | `-v` | | Increase verbosity (`-vv`, `-vvv`) | |
| 131 | +| Flag | Short | Env var | Description | |
| 132 | +| ----------------- | ----- | ------------------------ | ------------------------------------- | |
| 133 | +| `--profile` | `-p` | `FIRE_AUTH_PROFILE` | Named profile from config | |
| 134 | +| `--project` | | `FIRE_AUTH_PROJECT` | Firebase project ID | |
| 135 | +| `--credentials` | `-c` | `FIRE_AUTH_CREDENTIALS` | Path to service account JSON | |
| 136 | +| `--emulator-host` | `-e` | `FIRE_AUTH_EMULATOR_HOST`| Emulator host:port | |
| 137 | +| `--format` | `-f` | | Output format: `table`, `json`, `csv` | |
| 138 | +| `--dry-run` | | | Preview destructive operations | |
| 139 | +| `--yes` | `-y` | | Skip confirmation prompts | |
| 140 | +| `--verbose` | `-v` | | Increase verbosity (`-vv`, `-vvv`) | |
141 | 141 |
|
142 | 142 |
|
143 | 143 | ## Output formats |
144 | 144 |
|
145 | 145 | ```bash |
146 | | -fbadmin users list -f table # Human-readable table (default) |
147 | | -fbadmin users list -f json # NDJSON — one JSON object per line |
148 | | -fbadmin users list -f csv # CSV with headers |
149 | | -fbadmin claims get --email user@example.com -f json # Single record as JSON |
| 146 | +fire-auth users list -f table # Human-readable table (default) |
| 147 | +fire-auth users list -f json # NDJSON — one JSON object per line |
| 148 | +fire-auth users list -f csv # CSV with headers |
| 149 | +fire-auth claims get --email user@example.com -f json # Single record as JSON |
150 | 150 | ``` |
151 | 151 |
|
152 | 152 | ## License |
153 | 153 |
|
154 | | -AGPL-3.0-only — see [LICENSE](LICENSE). |
| 154 | +AGPL-3.0-only — see [LICENSE](LICENSE). |
0 commit comments