Skip to main content

licos-dev CLI

身份选择(0.6.0 起)

LICOS_CURRENT_USER_ID 表示容器启动时配置的执行用户,不代表网页登录者。模型目录、LLM、视觉、图片生成、视频生成、语音识别和 credit-check 命令支持以下身份选项:

运行时以 AGENT_CURRENT_USER_ID 注入执行用户时同样支持,不以项目负责人替代当前执行用户。企业和空间上下文沿用平台签发的认证结果。

选项 调用身份
--identity user(默认) 用 LICOS_CURRENT_USER_ID 和运行时服务凭证换取执行用户 Token
--identity project 使用运行时配置的项目所有者身份,不要求 LICOS_CURRENT_USER_ID
--token-stdin 优先使用标准输入传入的本次用户 Token,不再按容器用户换 Token;不能与 --identity project 同时使用

用户标识、名称和企业信息来自平台认证结果。项目所有者、工作空间等资源归属字段单独保留;模型实际计费上下文以平台模型详情接口签发的签名为准。

licos-dev credit-check --identity project
licos-dev model-catalog --identity user

HTTP 服务代表网页登录用户调用这些命令时,必须从本次认证会话取得 Token,通过 --token-stdin 写入子进程标准输入,不含 Bearer 前缀。例如在 Python 服务中:

import subprocess

# token 来自本次请求的认证会话。
result = subprocess.run(
    ["licos-dev", "credit-check", "--token-stdin"],
    input=token,
    text=True,
    capture_output=True,
    check=True,
)

以网页登录用户执行的业务入口缺少 Token 时应返回登录错误;不能依赖容器默认用户,也不能把请求 Token 或用户 ID 写入共享环境变量。默认用户模式缺少 LICOS_CURRENT_USER_ID、标准输入为空或显式 Token 鉴权失败时均返回非零退出码,不切换身份。Token 失效由调用方更新登录凭证后重新调用。

文档、图片排版等本地文件工具不需要用户身份选项。

直接使用 licos-dev-sdk 时,模型和积分接口默认是项目身份;需要按用户执行时传 user_token。CLI 的默认 --identity user 仅适用于独立命令行调用。

编程项目登录身份

  • 有内置登录时使用内置登录会话;没有内置登录时使用当前 LICOS 网页登录。内置登录未登录或过期时不能切换成平台用户。
  • Node 服务端使用 createProjectAuth({ mode: 'builtin', resolveBuiltinToken }) 或 createProjectAuth({ mode: 'platform' }),每次请求调用 await projectAuth.userToken(request)。内置解析器必须读取已有认证会话并返回用户已授权的 LICOS 凭证。
  • 无内置登录的浏览器用户接口使用 @kmlckj/licos-platform-sdk/browser 的 createProjectUserFetch:平台登录桥领取一次性票据,项目后端兑换 Token。不要直接读取跨域平台 localStorage,不在 URL 中传 Token,不修改全局 fetch。项目级 API 保持原有请求方法。
  • Python 使用 ProjectAuth;Agent/Workflow 通过 config/licos-auth.json 配置模式,内置登录设置 resolver: "模块:函数",业务代码使用 ctx.identity.user_token。
  • 当前用户、企业知识库、本体用户操作显式传 userToken/user_token。模型、积分和普通知识库按业务选择用户或项目身份。数据库、对象存储和可观测性继续使用项目身份。
  • 沿用现有 OAuth 授权范围与接口权限。凭证无权访问目标接口时返回现有鉴权错误,不扩大权限或换用其他身份。
  • 修改已有项目时先接它的现有登录机制,不能用新模板的默认平台模式覆盖。真实 Token 只存在于运行时请求/会话,不写入源代码、共享环境变量或 Agent 提示词。

Metadata

Release files for licos-dev-cli 0.6.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for licos-dev-cli 0.6.5
File Size Uploaded
licos_dev_cli-0.6.5.tar.gz 23.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for licos-dev-cli 0.6.5
File Interpreter ABI Platform
licos_dev_cli-0.6.5-py3-none-any.whl Python 3 none any Details

Total release size: 45.3 kB

Release files / licos_dev_cli-0.6.5.tar.gz

Download URL licos_dev_cli-0.6.5.tar.gz
Size 23.4 kB
Tags Source
SHA-256 checksum
How to use checksums
194e4d30ddfed714b6b5ca12e5f3ffac192edc84f0934614e5628726b804da4e
BLAKE2b-256 checksum
How to use checksums
737979da54f4d64f289f00a0c28250f68094c1dc844dfc3ad31c7726e122dec8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.7

Release files / licos_dev_cli-0.6.5-py3-none-any.whl

Download URL licos_dev_cli-0.6.5-py3-none-any.whl
Size 21.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ce268ec11a1859640fdef987418fb8e37fe4beedac696bbcb67857bf15573f0a
BLAKE2b-256 checksum
How to use checksums
ea2c446a0f6c843f4212af1031f7ad4cb47c7ed47ed34bc2d345b7ea109e3e81
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.7

Release history Release notifications | RSS feed

This release

0.6.5 This release

2 release files

0.6.4

2 release files

0.6.3

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.9

2 release files

0.4.8

2 release files

0.4.7

2 release files

0.4.6

2 release files

0.4.5

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.10

2 release files

0.3.9

2 release files

0.3.8

2 release files

0.3.7

2 release files

0.3.6

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.17

2 release files

0.2.16

2 release files

0.2.15

2 release files

0.2.10

2 release files

0.2.9

2 release files

0.2.8

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page