Back

[SOLVED] (automation) create a brand new project using Appwrite CLI

  • 0
  • Tools
Victor
22 Aug, 2023, 10:04

I am trying to automate the whole deployment/recreation of an appwrite application. Some parts I did with the GUI seem quite hard to automate with the CLI only (will open several tickets).

If I have a fresh installation and I want to create the very first project with the CLI this requires me a teamId, and leting it empty does not help:

TypeScript
AppwriteException [Error]: Team with the requested ID could not be found.```

Sure I cannot create a new team or apparently do nothing as almost all commands reply with

```$ appwrite teams create --teamId .... --name name
Error Project with the requested ID could not be found. Please check the value of the X-Appwrite-Project header to ensure the correct project ID is being used.```

How should I proceed using the CLI?
TL;DR
The user was trying to create a new project using the Appwrite CLI but was having trouble with the teamId parameter. They were unable to create a new team and most commands returned an error related to the project ID. The user was seeking guidance on how to proceed using the CLI. Solution: A user suggestion was to manually create the project using the console and inspect the network logs to see the API calls made. Then the user can recreate those calls using curl or use the CLI as a library. Another suggestion was to create a feature request for the missing functionality.
Binyamin
22 Aug, 2023, 14:00

The TeamID required is the organization one, the one you've created when first signing up into your Appwrite instance. You can find in the URL in the main projects page https://cloud.appwrite.io/console/organization-TEAM_ID

Victor
23 Aug, 2023, 08:30

no cloud... only self host

Victor
23 Aug, 2023, 08:30

will have to check that in detail

Victor
23 Aug, 2023, 08:31

@Binyamin I need somehow to query that, with rest or appwrite's CLI

Victor
23 Aug, 2023, 08:32
TypeScript
Error Access to this API is forbidden.
Victor
23 Aug, 2023, 08:37

the pointer you gave me is good, I can indeed create a project on the CLI this way

Victor
23 Aug, 2023, 08:37

just need to find out how to fetch non interactively the orgnization id

Victor
23 Aug, 2023, 09:16

so bad that appwrite teams list --json returns all memberships but not the organization which the same API with curl does indeed return it https://domain/v1/teams

Victor
23 Aug, 2023, 09:16

so frustrating

Binyamin
23 Aug, 2023, 13:19

For that part I think is best to create a feature request for it.

Binyamin
23 Aug, 2023, 13:20

You can do it by using the cli as library Check this

Drake
23 Aug, 2023, 23:45

Doing it using the CLI can be complicated considering switching between project IDs.

I highly recommend doing it manually via the console and inspecting the network logs using your browser dev tools. You'll see what API calls are made and then you can recreate those calls using curl

Victor
25 Aug, 2023, 08:32

thanks, that's how I ended up automating it

Victor
25 Aug, 2023, 08:37

[SOLVED] (automation) create a brand new project using Appwrite CLI

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more