Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
e7829a4
refactor: pull.ts file and introduce Pull class
ChiragAgg5k Jan 6, 2026
34e6d2e
only download code for selected functions and sites
ChiragAgg5k Jan 6, 2026
7dad33d
null fallback for holdingVars
ChiragAgg5k Jan 6, 2026
6c22b40
refactor duplicated deployment download code
ChiragAgg5k Jan 6, 2026
befc1de
type safety
ChiragAgg5k Jan 6, 2026
efe8d54
more type safety
ChiragAgg5k Jan 6, 2026
d512ac9
try catch errors while downloading code
ChiragAgg5k Jan 6, 2026
47ce78d
non deprecated methods
ChiragAgg5k Jan 6, 2026
b08b610
fix filtering
ChiragAgg5k Jan 6, 2026
a593586
grammer
ChiragAgg5k Jan 6, 2026
e3ff5c9
use query class
ChiragAgg5k Jan 6, 2026
707571b
typing
ChiragAgg5k Jan 6, 2026
8c0819f
improve zod config
ChiragAgg5k Jan 6, 2026
c4b91b0
deprecation
ChiragAgg5k Jan 6, 2026
a550d6a
chore shift attribute creation to seperate file
ChiragAgg5k Jan 6, 2026
e8d9543
simplify
ChiragAgg5k Jan 6, 2026
7863279
fix attempts
ChiragAgg5k Jan 6, 2026
a4b663d
grammer
ChiragAgg5k Jan 6, 2026
b414fce
more fixes
ChiragAgg5k Jan 6, 2026
9ace35c
util methods from push
ChiragAgg5k Jan 6, 2026
b887c5c
remove methods
ChiragAgg5k Jan 6, 2026
093a793
improvements
ChiragAgg5k Jan 6, 2026
0342f1a
fix constructor
ChiragAgg5k Jan 6, 2026
2395d93
more refactor
ChiragAgg5k Jan 7, 2026
1e3f49d
fix package deployment
ChiragAgg5k Jan 7, 2026
0f8f833
refactor deployment code
ChiragAgg5k Jan 7, 2026
9e3e9ed
use query clas
ChiragAgg5k Jan 7, 2026
9cd53ef
unused import
ChiragAgg5k Jan 7, 2026
c9b92e7
throw all errors
ChiragAgg5k Jan 7, 2026
7ab03f1
improve the definitive zod type
ChiragAgg5k Jan 7, 2026
23164ae
fix exports
ChiragAgg5k Jan 7, 2026
cd12942
formatting
ChiragAgg5k Jan 7, 2026
957d233
fix exports
ChiragAgg5k Jan 7, 2026
1ae4c27
schema validation
ChiragAgg5k Jan 7, 2026
6d2841b
db
ChiragAgg5k Jan 7, 2026
8aa0503
fix options
ChiragAgg5k Jan 7, 2026
6e4fb9f
unused import
ChiragAgg5k Jan 7, 2026
1729b78
fix exports
ChiragAgg5k Jan 7, 2026
a15c154
fix exports
ChiragAgg5k Jan 7, 2026
c3cf582
fix optionals
ChiragAgg5k Jan 7, 2026
0a26d6b
fix package
ChiragAgg5k Jan 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Change Log

## 13.0.0-rc.2
## 13.0.0-rc.3

- Push, Pull and Schema classes are now exported as part of the package
- Fixes a lot of typescript errors throughout the codebase

## 13.0.0-rc.2
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Once the installation is complete, you can verify the install using

```sh
$ appwrite -v
13.0.0-rc.2
13.0.0-rc.3
```

### Install using prebuilt binaries
Expand Down Expand Up @@ -69,7 +69,7 @@ Once the installation completes, you can verify your install using

```
$ appwrite -v
13.0.0-rc.2
13.0.0-rc.3
```

## Getting Started
Expand Down
5 changes: 4 additions & 1 deletion bun.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"name": "appwrite-cli",
"dependencies": {
"@appwrite.io/console": "^2.1.0",
"@types/bun": "^1.3.5",
"chalk": "4.1.2",
"chokidar": "^3.6.0",
"cli-progress": "^3.12.0",
Expand All @@ -21,8 +20,10 @@
"tail": "^2.2.6",
"tar": "^6.1.11",
"undici": "^5.28.2",
"zod": "^4.3.5",
},
"devDependencies": {
"@types/bun": "^1.3.5",
"@types/cli-progress": "^3.11.5",
"@types/inquirer": "^8.2.10",
"@types/json-bigint": "^1.0.4",
Expand Down Expand Up @@ -531,6 +532,8 @@

"yargs-parser": ["yargs-parser@20.2.9", "", {}, "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w=="],

"zod": ["zod@4.3.5", "", {}, "sha512-k7Nwx6vuWx1IJ9Bjuf4Zt1PEllcwe7cls3VNzm4CQ1/hgtFUK2bRNG3rvnpPUhFjmqJKAKtjV576KnUkHocg/g=="],

"@isaacs/fs-minipass/minipass": ["minipass@7.1.2", "", {}, "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw=="],

"@yao-pkg/pkg/tar": ["tar@7.5.2", "", { "dependencies": { "@isaacs/fs-minipass": "^4.0.0", "chownr": "^3.0.0", "minipass": "^7.1.2", "minizlib": "^3.1.0", "yallist": "^5.0.0" } }, "sha512-7NyxrTE4Anh8km8iEy7o0QYPs+0JKBTj5ZaqHg6B39erLg0qYXN3BijtShwbsNSvQ+LN75+KV+C4QR/f6Gwnpg=="],
Expand Down
168 changes: 168 additions & 0 deletions cli.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
#! /usr/bin/env node

/** Required to set max width of the help commands */
const oldWidth = process.stdout.columns;
process.stdout.columns = 100;
/** ---------------------------------------------- */

import { program } from "commander";
import chalk from "chalk";
import packageJson from "./package.json" with { type: "json" };
const { version } = packageJson;
import { commandDescriptions, cliConfig } from "./lib/parser.js";
import { client } from "./lib/commands/generic.js";
import { getLatestVersion, compareVersions } from "./lib/utils.js";
import inquirer from "inquirer";
import {
login,
logout,
whoami,
migrate,
register,
} from "./lib/commands/generic.js";
import { init } from "./lib/commands/init.js";
import { types } from "./lib/commands/types.js";
import { pull } from "./lib/commands/pull.js";
import { run } from "./lib/commands/run.js";
import { push, deploy } from "./lib/commands/push.js";
import { update } from "./lib/commands/update.js";
import { account } from "./lib/commands/services/account.js";
import { console } from "./lib/commands/services/console.js";
import { databases } from "./lib/commands/services/databases.js";
import { functions } from "./lib/commands/services/functions.js";
import { graphql } from "./lib/commands/services/graphql.js";
import { health } from "./lib/commands/services/health.js";
import { locale } from "./lib/commands/services/locale.js";
import { messaging } from "./lib/commands/services/messaging.js";
import { migrations } from "./lib/commands/services/migrations.js";
import { project } from "./lib/commands/services/project.js";
import { projects } from "./lib/commands/services/projects.js";
import { proxy } from "./lib/commands/services/proxy.js";
import { sites } from "./lib/commands/services/sites.js";
import { storage } from "./lib/commands/services/storage.js";
import { tablesdb } from "./lib/commands/services/tablesdb.js";
import { teams } from "./lib/commands/services/teams.js";
import { tokens } from "./lib/commands/services/tokens.js";
import { users } from "./lib/commands/services/users.js";
import { vcs } from "./lib/commands/services/vcs.js";
import searchList from "inquirer-search-list";

inquirer.registerPrompt("search-list", searchList);

/**
* Check for updates and show version information
*/
async function checkVersion(): Promise<void> {
process.stdout.write(chalk.bold(`appwrite version ${version}`) + "\n");

try {
const latestVersion = await getLatestVersion();
const comparison = compareVersions(version, latestVersion);

if (comparison > 0) {
// Current version is older than latest
process.stdout.write(
chalk.yellow(
`\n⚠️ A newer version is available: ${chalk.bold(latestVersion)}`,
) + "\n",
);
process.stdout.write(
chalk.cyan(
`💡 Run '${chalk.bold("appwrite update")}' to update to the latest version.`,
) + "\n",
);
} else if (comparison === 0) {
process.stdout.write(
chalk.green("\n✅ You are running the latest version!") + "\n",
);
} else {
// Current version is newer than latest (pre-release/dev)
process.stdout.write(
chalk.blue(
"\n🚀 You are running a pre-release or development version.",
) + "\n",
);
}
} catch (error) {
// Silently fail version check, just show current version
process.stdout.write(chalk.gray("\n(Unable to check for updates)") + "\n");
}
}

// Intercept version flag before Commander.js processes it
if (process.argv.includes("-v") || process.argv.includes("--version")) {
(async () => {
await checkVersion();
process.exit(0);
})();
} else {
program
.description(commandDescriptions["main"])
.configureHelp({
helpWidth: process.stdout.columns || 80,
sortSubcommands: true,
})
.helpOption("-h, --help", "Display help for command")
.version(version, "-v, --version", "Output the version number")
.option("-V, --verbose", "Show complete error log")
.option("-j, --json", "Output in JSON format")
.hook("preAction", migrate)
.option("-f,--force", "Flag to confirm all warnings")
.option("-a,--all", "Flag to push all resources")
.option("--id [id...]", "Flag to pass a list of ids for a given action")
.option("--report", "Enable reporting in case of CLI errors")
.on("option:json", () => {
cliConfig.json = true;
})
.on("option:verbose", () => {
cliConfig.verbose = true;
})
.on("option:report", function () {
cliConfig.report = true;
cliConfig.reportData = { data: this };
})
.on("option:force", () => {
cliConfig.force = true;
})
.on("option:all", () => {
cliConfig.all = true;
})
.on("option:id", function () {
cliConfig.ids = (this as any).opts().id;
})
.showSuggestionAfterError()
.addCommand(whoami)
.addCommand(register)
.addCommand(login)
.addCommand(init)
.addCommand(pull)
.addCommand(push)
.addCommand(types)
.addCommand(deploy)
.addCommand(run)
.addCommand(update)
.addCommand(logout)
.addCommand(account)
.addCommand(console)
.addCommand(databases)
.addCommand(functions)
.addCommand(graphql)
.addCommand(health)
.addCommand(locale)
.addCommand(messaging)
.addCommand(migrations)
.addCommand(project)
.addCommand(projects)
.addCommand(proxy)
.addCommand(sites)
.addCommand(storage)
.addCommand(tablesdb)
.addCommand(teams)
.addCommand(tokens)
.addCommand(users)
.addCommand(vcs)
.addCommand(client)
.parse(process.argv);

process.stdout.columns = oldWidth;
}
Loading