# 引数を受け取る

{% code title="index.js" %}

```javascript
#! /usr/bin/env node
const args = process.argv.slice(2); // process.argv に引数も含まれている
console.log("arg", args[0]); // args は配列なので、その最初の値を使用する
```

{% endcode %}

```bash
npx cli test-arg
```

or

```bash
cli test-arg # npm link していれば global にコマンドが存在するように実行できる
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://super-yusuke.gitbook.io/automate-the-boring-stuff-with-node-js/node-dekomandoraintsruworou/wokeru.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
