npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@polza-ai/amocrm-cli

v0.1.0

Published

CLI для amoCRM / Kommo — для людей и AI-агентов

Readme

amo-cli

CLI для amoCRM / Kommo — для людей и AI-агентов. Построен по образцу yandex-tracker-cli: TypeScript + Commander.js + Axios, табличный и JSON-вывод.

Установка

npm install -g @polza-ai/amocrm-cli
amo --help

Или разово через npx:

npx @polza-ai/amocrm-cli init

Из исходников (для разработки):

git clone https://github.com/polza-ai/amocrm-cli.git
cd amocrm-cli && npm install && npm run build
npm link                        # команда `amo` глобально
npm run dev -- <команда>        # запуск без сборки (tsx)

Авторизация

Используется долгоживущий токен приватной интеграции (не требует OAuth refresh):

  1. В amoCRM: Настройки → Интеграции → «+ Создать интеграцию» → приватная интеграция.
  2. Вкладка «Ключи и доступы» → «Сгенерировать долгоживущий токен» (срок до 5 лет), скопируйте.
  3. Запустите amo init и вставьте поддомен + токен.

Конфиг хранится в ~/.amo-cli/config.json. Проектный конфиг .amo.json (ищется вверх по дереву) переопределяет поддомен/токен и задаёт defaultPipelineId. .amo.json добавлен в .gitignore — не коммитьте токены.

Команды

| Команда | Назначение | |---------|------------| | amo init | Интерактивная настройка (поддомен, токен, воронка по умолчанию) | | amo account | Данные аккаунта и список пользователей | | amo pipelines | Воронки и их статусы (id для фильтров) | | amo leads list\|get\|create\|update | Сделки | | amo contacts list\|get\|create\|update | Контакты | | amo companies list\|get\|create\|update | Компании | | amo tasks list\|get\|create\|complete | Задачи | | amo notes list\|add <тип> <id> | Примечания к сущности | | amo pipelines list\|create\|update\|delete | Воронки продаж | | amo statuses list\|get\|create\|update\|delete <pipelineId> | Статусы воронки | | amo custom-fields list\|get\|create\|update\|delete <тип> | Кастомные поля | | amo tags list\|add <тип> | Теги | | amo catalogs list\|get\|create\|update · amo catalogs elements ... <catalogId> | Каталоги (списки) и элементы | | amo links list\|add\|remove <тип> <id> | Связи сущностей | | amo webhooks list\|subscribe\|delete | Вебхуки | | amo users list\|get · amo roles list\|get | Пользователи и роли | | amo events list\|types | Лента событий | | amo loss-reasons | Причины отказа |

<тип>leads | contacts | companies.

Общие флаги: --json (машинный вывод), --limit <n> / --all (пагинация), --query (поиск), --with (вложенные данные), --dry-run (показать тело запроса без отправки), --field id=value (кастомные поля, повторяемо).

Примеры

amo account                                   # проверить подключение
amo pipelines                                 # узнать id воронок и статусов
amo leads list --limit 5                      # последние 5 сделок (таблица)
amo leads list --pipeline 3 --status 142 --json
amo leads get 12345 --with contacts           # сделка с контактами
amo leads create -n "Новая сделка" --price 50000 --pipeline 3 --dry-run
amo leads update 12345 --status 143           # перевести по воронке
amo contacts create -n "Иван Петров" --field [email protected]
amo tasks list --entity-type leads --entity-id 12345 --open
amo tasks create -t "Позвонить" --entity-type leads --entity-id 12345 --due 2026-07-01
amo tasks complete 777 --result "Дозвонился"
amo notes add leads 12345 -t "Комментарий по сделке"
amo custom-fields list contacts                # id/коды полей для --field
amo statuses list 3                            # id статусов воронки
amo catalogs list                              # каталоги (товары, счета ...)
amo links add leads 12345 --to-type contacts --to-id 678   # связать
amo webhooks subscribe https://my.app/hook -e add_lead -e update_lead

Кастомные поля (--field)

--field 123=Текст           # текстовое поле id=123
--field 123:456=Опция       # значение списка/мультисписка с enum_id 456
--field PHONE=+79990001122  # поле по коду
--field 123=a --field 123=b # несколько значений одного поля

Вывод

  • stdout — только данные (таблица или JSON-конверт { "ok": true, "data": ... }).
  • stderr — логи и ошибки. JSON-ошибки: { "ok": false, "error": { "code", "message" } }.
  • Коды выхода: 2 — авторизация/доступ, 3 — не найдено, 4 — валидация, 1 — прочее.

Разработка

npm run dev -- leads list   # запуск из исходников (tsx)
npm test                    # юнит-тесты (vitest)
npm run typecheck           # проверка типов
npm run lint                # eslint
npm run build               # сборка в dist/

API: Kommo/amoCRM REST API v4. Базовый URL — https://{subdomain}.amocrm.ru/api/v4.