# website

> वह command जिससे एजेंट किसी प्रोजेक्ट की website list रखते हैं, वही list जो AirBuild ऐप का Website tab दिखाता है।

Source: https://air.build/hi/docs/cli/website/

`website` किसी प्रोजेक्ट से जुड़ी websites की सूची रखता है: वे sites जो लोग AirBuild ऐप में प्रोजेक्ट के **Website** tab में देखते हैं। एजेंट title और address के साथ एक site जोड़ता है, और फिर AirBuild उसके icon और theme colour के लिए page पढ़ता है। यह सूची AirBuild में प्रोजेक्ट के साथ रहती है; प्रोजेक्ट की files में इसका कोई ब्योरा नहीं होता।

## यह कहाँ चलता है

यही command cloud टीम और Mac टीम, दोनों के एजेंट्स के लिए उपलब्ध है। Sign-in एजेंट के environment से आता है, इसलिए कुछ सेट नहीं करना पड़ता। Command को `curl` और `jq` चाहिए, जो environment देता है। दोनों तरह की टीमों के लिए देखें [चुनें कि आपके एजेंट कहाँ चलें](https://air.build/hi/docs/get-started/where-agents-run/)।

## Synopsis

```text
website [--project <project-id>] list
website [--project <project-id>] add --title T --url U [--source PATH] [--worker NAME] [--color #RRGGBB]
website [--project <project-id>] edit <id|url> [--title T] [--url U] [--source PATH] [--worker NAME] [--color #RRGGBB]
website [--project <project-id>] move <id|url> --to N
website [--project <project-id>] refresh <id|url>
website [--project <project-id>] remove <id|url> --confirm
website --help
```

`--project` line में कहीं भी आ सकता है। हर option `--option=value` रूप भी स्वीकार करता है।

## कौन-सा प्रोजेक्ट

किसी प्रोजेक्ट के folder के अंदर से चलाने पर `website` खुद प्रोजेक्ट पहचान लेता है। कहीं और से, प्रोजेक्ट के id (एक UUID) के साथ `--project` दें। दोनों में से कुछ न होने पर यह इस message के साथ रुक जाता है:

```text
Error: cannot tell which Project this is. Run website from inside a Project directory, or pass --project <project-id> (the uuid from list_projects).
```

## Site का नाम देना

`edit`, `move`, `refresh` और `remove` site को उसके id (`website list` से) या उसके address से लेती हैं। Address आख़िर के slash के साथ या उसके बिना, दोनों तरह मेल खाता है।

## Commands

| Command | यह क्या करती है | क्या दिखाती है |
| --- | --- | --- |
| `list` | प्रोजेक्ट की websites क्रम से दिखाती है। कोई argument नहीं लेती। | हर site की एक line (देखें [Output](https://air.build/hi/docs/cli/website/#output)), या `No websites listed for this Project yet. Add one with website add --title … --url ….` |
| `add` | सूची के अंत में एक site जोड़ती है। `--title` और `--url` ज़रूरी हैं। जोड़ने के बाद page का icon और theme colour पढ़ा जाता है। | `Added <title> — <url> (id <id>). The page is being read for its icon and colour.` |
| `edit` | सिर्फ़ वही fields बदलती है जो आप देते हैं; कम से कम एक चाहिए। `--source`, `--worker` या `--color` खाली करने के लिए खाली value (`""`) दें। नया address page को फिर पढ़ता है। | `Updated <title> — <url>.` |
| `move` | Site को position N पर रखती है; `0` पहला है। अंत से आगे की position उसे आख़िर में रख देती है। | नए क्रम में पूरी सूची। |
| `refresh` | Icon और colour के लिए page फिर पढ़ती है। | `Reading the page again; website list shows the result in a moment.` |
| `remove` | Site को सूची से हटाती है। `--confirm` चाहिए। | `Removed.` |

## Fields

| Option | Value | मतलब |
| --- | --- | --- |
| `--title` | 1–80 characters | सूची में site का नाम। |
| `--url` | एक absolute `http://` या `https://` address | Site का address। प्रोजेक्ट की सूची में हर address एक ही बार आता है। |
| `--source` | प्रोजेक्ट के root से एक path, 512 characters तक | प्रोजेक्ट में site का code कहाँ है। |
| `--worker` | Worker का नाम | वह AirHost worker जो site serve करता है। कहीं और host की गई site के लिए इसे छोड़ दें। |
| `--color` | `#RRGGBB` | Site का theme colour। इस तरह सेट किया colour page फिर पढ़े जाने पर भी बना रहता है; `""` से खाली करने पर page के `theme-color` से पढ़ा गया colour लागू हो जाता है। |
| `--to` | पूर्ण संख्या, `0` या ज़्यादा | सिर्फ़ `move`: नई position। |
| `--confirm` | — | सिर्फ़ `remove`: हटाने की पुष्टि करता है। |
| `--project` | प्रोजेक्ट id (UUID) | किस प्रोजेक्ट के लिए काम करना है। प्रोजेक्ट के folder के अंदर वैकल्पिक। |

एक प्रोजेक्ट में अधिकतम 50 websites हो सकती हैं।

## Output

`list` और `move` हर site की एक line क्रम से दिखाती हैं:

```text
<id>  <title> — <url>  worker=<name>  source=<path>  color=<#RRGGBB>  icon
```

`worker=`, `source=` और `color=` सिर्फ़ तब दिखते हैं जब वे पता हों। Line `icon` पर खत्म होती है जब AirBuild के पास page का icon हो, वरना `no-icon` पर।

## Exit codes

| Code | मतलब |
| --- | --- |
| `0` | सफल। |
| `2` | कोई भी error। stderr पर message `Error:` से शुरू होता है। |

## Errors

| Message | क्या करें |
| --- | --- |
| `Error: cannot tell which Project this is. …` | इसे प्रोजेक्ट के folder से चलाएँ, या `--project` दें। |
| `Error: --project expects a Project id (uuid), got: …` | प्रोजेक्ट का नाम नहीं, UUID दें। |
| `Error: no website with the address '…' in this Project. Run website list.` | `website list` से address मिलाएँ, या site का id इस्तेमाल करें। |
| `Error: website add needs --url.` | `--url` जोड़ें। `--title` न होने पर `add` की usage line दिखती है। |
| `Error: website edit needs at least one of --title, --url, --source, --worker, --color.` | जो field बदलना है, वह दें। |
| `Error: usage: website move … --to N` | `--to` को पूर्ण संख्या चाहिए। |
| `Error: removing a site from the list needs --confirm.` | `--confirm` जोड़ें। |
| `Error: unknown option '…' for website <command>. Run website --help.` | ऊपर की table से option मिलाएँ। |
| `Error: could not reach the Airbuild service.` | फिर कोशिश करें। |
| `Error: <reason>` | AirBuild ने request ठुकरा दी: जैसे 1–80 characters से बाहर का title, ऐसा address जो absolute `http(s)` नहीं है, ऐसा address जो प्रोजेक्ट की सूची में पहले से है, ऐसा colour जो `#RRGGBB` नहीं है, या ऐसी सूची जिसमें पहले से 50 sites हैं। Reason बताता है कि कौन-सी वजह है; उसे ठीक करके command फिर चलाएँ। |

## उदाहरण

ऐप का support page जोड़ें और उसे एक colour दें:

```bash
website add --title "Support" --url https://example.com/support --color "#1E88E5"
```

दर्ज करें कि कोई site एक worker से serve होती है और प्रोजेक्ट के एक folder से बनती है:

```bash
website edit https://example.com --worker example-site --source web/
```

किसी site को पहले स्थान पर रखें और सूची जाँचें:

```bash
website move https://example.com/privacy --to 0
website list
```

एक site हटाएँ:

```bash
website remove 6f1c2d3e-0000-4000-8000-000000000000 --confirm
```
