
Security News
AGENTS.md Gains Traction as an Open Format for AI Coding Agents
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
@nesto-software/inquirer-s3
Advanced tools
An S3 object selector for inquirer.
Current version: 1.0.1
Lead Maintainer: Halim Qarroum
To add the inquirer-s3
prompt to your application dependencies, run the following command :
npm install --save inquirer-s3
The inquirer-s3
prompt allows you to use inquirer to select an S3 object located on an AWS account. This prompt allows you to list buckets, objects within selected buckets and navigate across your buckets.
In order to use inquirer-s3
, you first need to register it with inquirer under a key name as follow.
const inquirer = require('inquirer');
// Registers `inquirer-s3` under the key 's3-object'.
inquirer.registerPrompt('s3-object', require('inquirer-s3'));
By default, the inquirer-s3
prompt will list the S3 content of a given AWS account in a file-system like fashion, starting by listing available buckets in a given region, and allowing the promnpted user to navigate its buckets and objects. To start a prompt, you can use with inquirer
the key that you used to register the inquirer-s3
module.
inquirer.prompt([{
type: 's3-object',
name: 'result',
message: 'Which S3 object would you like to select?'
}]).then(console.log);
A set of optional parameters can be passed to inquirer-s3
. Below is a description of all the optional parameters along with their role.
bucket
parameter with the name of a valid S3 account owned by your AWS account, the inquirer-s3
module will start to browse at the root of this bucket.bucket
parameter specified, default trueNote that it is invalid to pass an
objectPrefix
without specifying a validbucket
, and an error will be thrown in this case.
When an error occurs, the promise returned by inquirer
is still resolved, but will contain an err
property as in the following sample output. This is due to the fact that there are no easy way to reject the promise in Inquirer from inside a plugin prompt.
{ result: {
err: {
message: 'Missing credentials in config',
errno: 'ETIMEDOUT'
}
}
The inquirer-s3
plugin needs to retrieve STS tokens from AWS in order to interact with the S3 service on your account. The easiest way to achieve this is to have the AWS CLI installed and configured on your development or deployment machine.
Read more on Installing the AWS CLI and Configuring the AWS CLI.
If you happen to have the AWS CLI installed and configured with valid credentials on your local machine, inquirer-s3
will automatically use these credentials to authenticate against the AWS services it is making requests against.
If you have configured the AWS CLI with different profiles, it is possible to explicitly specify an AWS profile to use by specifying the AWS_PROFILE
variable in your environment such as in the following example.
AWS_PROFILE=my-custom-profile node examples/s3-object-list.js
If you do not have the AWS CLI installed or configured, or you would like to use inquirer-s3
with custom credentials, you can pass your AWS_ACCESS_KEY_ID
and your AWS_SECRET_ACCESS_KEY
as environment variables of ur application such as in the following example :
$ AWS_ACCESS_KEY_ID=<access-key-id> AWS_SECRET_ACCESS_KEY=<secret-access-key> node examples/s3-object-list.js
If you are using temporary credentials you can also specify an
AWS_SESSION_TOKEN
additionally to the aforementioned variables.
Runnable examples are available in the examples directory.
FAQs
An S3 bucket and object selector for Inquirer.
We found that @nesto-software/inquirer-s3 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.