{"id":17038,"library":"nemar-cli","title":"NEMAR CLI","description":"The nemar-cli package provides a command-line interface for managing datasets within NEMAR (Neuroelectromagnetic Data Archive and Tools Resource), an initiative focused on curating and sharing human neuroelectromagnetic (EEG, MEG, iEEG) data. It facilitates interaction with BIDS-formatted datasets, often leveraging DataLad for version control and data management, and integrating with resources like OpenNeuro. This CLI is designed to help researchers create, update, and manage neuroimaging datasets, particularly those with restrictive licenses that prevent hosting on fully public repositories, while still ensuring free access for academic use. The current stable version is 0.7.26, indicating active development with potential for frequent updates and feature enhancements before a 1.0 release. Its key differentiators include specialized support for neuroimaging data standards (BIDS), integration with advanced data versioning systems (DataLad), and its role in an ecosystem that provides high-performance computing resources via the Neuroscience Gateway. It aims to streamline data management workflows for neuroscientists.","status":"active","version":"0.7.26","language":"javascript","source_language":"en","source_url":"https://github.com/nemarOrg/nemar-cli","tags":["javascript","nemar","bids","neuroimaging","eeg","emg","datalad","cli"],"install":[{"cmd":"npm install nemar-cli","lang":"bash","label":"npm"},{"cmd":"yarn add nemar-cli","lang":"bash","label":"yarn"},{"cmd":"pnpm add nemar-cli","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core data management functionality, especially for versioning and accessing large datasets stored on platforms like AWS S3. DataLad itself relies on git-annex.","package":"datalad","optional":false},{"reason":"Underpins DataLad's ability to manage large files efficiently by storing file contents outside of Git's primary repository, using symlinks. Essential for DataLad functionality.","package":"git-annex","optional":false}],"imports":[{"note":"As a CLI tool, nemar-cli is typically installed globally or executed via npx/bunx. It does not export JavaScript modules for direct import into other applications. The primary interaction is through shell commands.","wrong":"import nemarCli from 'nemar-cli'","symbol":"nemar-cli","correct":"npm install -g nemar-cli\nnemar-cli --version"},{"note":"Using `npx` (or `bunx`) allows executing the CLI without a global installation, ensuring the correct version from `node_modules` is used or fetching it if not locally available. Direct `node` execution is only for development or specific package structures.","wrong":"node nemar-cli.js --help","symbol":"nemar-cli","correct":"npx nemar-cli --help"},{"note":"Commands typically follow a hierarchical structure (e.g., `command subcommand [options]`). Refer to `nemar-cli --help` or specific subcommand help for exact syntax and available flags.","wrong":"nemar-cli createdataset MyNewDataset","symbol":"nemar-cli dataset create","correct":"nemar-cli dataset create --name 'MyNewDataset' --bids --datalad"}],"quickstart":{"code":"#!/bin/bash\n\n# Ensure Bun is installed and meets the engine requirement.\nif ! command -v bun &> /dev/null || ! bun --version | grep -q \"^1\\.\"; then\n  echo \"Error: Bun (version >=1.0.0) is required but not found or not compatible.\"\n  echo \"Please install Bun: https://bun.sh/docs/installation\"\n  exit 1\nfi\n\n# Install the nemar-cli globally using Bun\nbun install -g nemar-cli\n\necho \"\\nNEMAR CLI installed. Verifying installation:\"\nnemar-cli --version\n\necho \"\\nListing available commands:\"\nnemar-cli --help\n\necho \"\\nExample: Initializing a new NEMAR dataset (interactive, requires user input):\"\n# This command initiates an interactive process for dataset creation.\n# For automated scripts, specific subcommands and flags would be used.\n# nemar-cli dataset create\n\necho \"\\nTo clean up the global installation (optional):\"\n# bun uninstall -g nemar-cli\n","lang":"bash","description":"This quickstart demonstrates how to install `nemar-cli` globally using Bun and verify its installation and basic functionality by checking the version and displaying the main help message. It emphasizes the Bun engine requirement and shows how to explore available commands."},"warnings":[{"fix":"Ensure Bun is installed globally and updated to at least version 1.0.0. Use `bun install -g nemar-cli` to leverage Bun's package management.","message":"The package requires Bun runtime version >=1.0.0. Using Node.js or an older Bun version will result in errors and prevent the CLI from running.","severity":"breaking","affected_versions":"<=0.7.26"},{"fix":"Pin the exact version of `nemar-cli` in your project dependencies (`package.json`) and review the GitHub repository's release notes or changelog before updating to a newer version.","message":"As a pre-1.0.0 release, `nemar-cli` may introduce breaking changes in minor or patch versions. Command syntax, options, or output formats can change without a major version bump, requiring frequent review of release notes.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Install DataLad and git-annex via your system's package manager (e.g., `apt`, `brew`, `conda`). Refer to the DataLad documentation for detailed installation instructions and system requirements.","message":"`nemar-cli` integrates with DataLad for dataset management. Proper functioning requires DataLad and its dependencies (like git-annex) to be installed and configured correctly on the user's system, which are external to npm.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Ensure your AWS CLI is configured with valid credentials (`aws configure`) or that environment variables (e.g., `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`) are set, as DataLad often relies on these for cloud access.","message":"When running `nemar-cli` commands that interact with cloud storage (e.g., AWS S3 for DataLad datasets), appropriate authentication and authorization credentials must be configured in your environment.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-04-22T00:00:00.000Z","next_check":"2026-07-21T00:00:00.000Z","problems":[{"fix":"Install globally: `bun install -g nemar-cli`. Or use `npx nemar-cli [command]` or `bunx nemar-cli [command]`.","cause":"The `nemar-cli` executable is not in your system's PATH, either because it wasn't installed globally or `npx`/`bunx` was not used.","error":"nemar-cli: command not found"},{"fix":"Install Bun or update it to the latest version (e.g., `curl -fsSL https://bun.sh/install | bash`) and ensure your shell is configured to use it.","cause":"The `nemar-cli` package specifies a `bun` engine requirement (>=1.0.0) which is not met by the current runtime.","error":"Error: Bun (version >=1.0.0) is required but not found or not compatible."},{"fix":"Install `git-annex` using your system's package manager (e.g., `sudo apt install git-annex`, `brew install git-annex`) and verify it's in your PATH (`which git-annex`).","cause":"DataLad, which `nemar-cli` depends on for certain operations, requires `git-annex` to be installed and accessible in your system's PATH.","error":"DataLadError: 'git-annex' is not available in PATH"},{"fix":"Review the BIDS specification for the required file structure and naming conventions. Use BIDS validators to check your dataset before using `nemar-cli` commands that rely on BIDS compliance.","cause":"A dataset operation failed due to non-compliance with the Brain Imaging Data Structure (BIDS) specification, often related to missing or incorrectly named files/metadata.","error":"BIDSValidationError: Subject 'sub-01' is missing required file 'sub-01_ses-01_task-rest_eeg.bids.json'"}],"ecosystem":"npm","meta_description":null}