ardent-cli 0.0.42 → 0.0.43

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 (2) hide show
  1. package/dist/index.js +29 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1786,6 +1786,9 @@ async function createAction2(type, url, options) {
1786
1786
  if (parsed.ssl_mode !== void 0) {
1787
1787
  connectionDetails.ssl_mode = parsed.ssl_mode;
1788
1788
  }
1789
+ if (parsed.database !== void 0) {
1790
+ connectionDetails.database = parsed.database;
1791
+ }
1789
1792
  createPayload = {
1790
1793
  name: connectorName,
1791
1794
  service_name: "postgresql",
@@ -4632,14 +4635,14 @@ function logoutAction() {
4632
4635
 
4633
4636
  // src/commands/auth/status.ts
4634
4637
  function statusAction() {
4635
- const token = getConfig("token");
4638
+ const token = getToken();
4636
4639
  if (!token) {
4637
4640
  trackEvent("CLI: auth status", { authenticated: false });
4638
4641
  console.log("\u2717 Not authenticated");
4639
4642
  console.log(" Run: ardent login");
4640
4643
  return;
4641
4644
  }
4642
- const user = getConfig("user");
4645
+ const user = getConfig("token") ? getConfig("user") : void 0;
4643
4646
  console.log("\u2713 Authenticated");
4644
4647
  if (user?.full_name) {
4645
4648
  console.log(` Account: ${user.full_name}`);
@@ -4658,7 +4661,12 @@ function statusAction() {
4658
4661
  }
4659
4662
 
4660
4663
  // src/commands/auth/index.ts
4661
- var loginCommand = new Command7("login").description("Login to Ardent").option("-t, --token <token>", "API token (skip browser login)").action(loginAction);
4664
+ var loginCommand = new Command7("login").description(
4665
+ "Login to Ardent. Defaults to GitHub OAuth in the browser; pass --token for headless auth, or set the ARDENT_TOKEN env var to skip 'ardent login' entirely."
4666
+ ).option(
4667
+ "-t, --token <token>",
4668
+ "API token for headless auth (skip browser login). For repeat headless use, prefer the ARDENT_TOKEN env var."
4669
+ ).action(loginAction);
4662
4670
  var logoutCommand = new Command7("logout").description("Logout from Ardent").action(logoutAction);
4663
4671
  var statusCommand = new Command7("status").description("Show status").action(statusAction);
4664
4672
 
@@ -4744,6 +4752,7 @@ USAGE
4744
4752
 
4745
4753
  AUTHENTICATION
4746
4754
  login Login via browser (GitHub OAuth)
4755
+ login --token <token> Login with an API token (headless, no browser)
4747
4756
  logout Clear stored credentials
4748
4757
  status Check authentication status
4749
4758
 
@@ -4785,12 +4794,29 @@ OPTIONS
4785
4794
  --help Show help for any command
4786
4795
  --version Show CLI version
4787
4796
 
4797
+ ENVIRONMENT
4798
+ ARDENT_TOKEN API token used for every request. When set, no
4799
+ 'ardent login' is needed \u2014 ideal for CI and other
4800
+ headless contexts. Generate one in the web app
4801
+ under Settings > API Keys.
4802
+ ARDENT_API_URL Override the API endpoint
4803
+ (default: https://api.tryardent.com).
4804
+
4788
4805
  EXAMPLES
4789
4806
  ardent login
4790
4807
  ardent connector create postgresql postgresql://user:password@your-db-host.com:5432/database
4791
4808
  ardent branch create my-feature
4792
4809
  ardent branch switch my-feature
4793
4810
  ardent org members
4811
+
4812
+ # Headless / CI (GitHub Actions)
4813
+ # env:
4814
+ # ARDENT_TOKEN: \${{ secrets.ARDENT_TOKEN }}
4815
+ # run: |
4816
+ # BRANCH="pr-\${{ github.event.number }}-\${{ github.run_id }}"
4817
+ # ardent branch create "$BRANCH"
4818
+ # # ... run your migration / tests against the branch ...
4819
+ # ardent branch delete "$BRANCH"
4794
4820
  `;
4795
4821
  var program = new Command8();
4796
4822
  program.name("ardent").description("CLI for Ardent database branching").version(CLI_VERSION).configureHelp({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ardent-cli",
3
- "version": "0.0.42",
3
+ "version": "0.0.43",
4
4
  "description": "Git for Data infrastructure",
5
5
  "type": "module",
6
6
  "bin": {